:root {
  --av-red: #ff383f;
  --av-red-soft: #ff383f22;
  --av-red-glow: 0 0 60px rgba(255, 56, 63, 0.25);
  --av-black: #000000;
  --av-ink: #0a0a0b;
  --av-surface: #0f0f10;
  --av-surface-2: #151518;
  --av-surface-3: #1d1d22;
  --av-line: #22222a;
  --av-line-soft: #17171c;
  --av-muted: #70707a;
  --av-text: #eeeef2;
  --av-text-dim: #a8a8b2;
  --av-white: #ffffff;
  --av-code-bg: #0b0b0d;
  --av-shadow-deep: rgba(0, 0, 0, 0.6);
  --av-scrollbar: #2a2a30;
  --av-scrollbar-hover: #3a3a45;
  --av-glow-a: rgba(255, 56, 63, 0.12);
  --av-glow-b: rgba(255, 56, 63, 0.06);
  --av-overlay: rgba(0, 0, 0, 0.6);
  --av-backdrop: rgba(0, 0, 0, 0.55);
  --av-hover-tint: rgba(255, 255, 255, 0.03);
  --av-hover-tint-strong: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
  --av-red: #ff383f;
  --av-red-soft: #ff383f14;
  --av-red-glow: 0 0 60px rgba(255, 56, 63, 0.18);
  --av-black: #f5f5f7;
  --av-ink: #ffffff;
  --av-surface: #ffffff;
  --av-surface-2: #f7f7fa;
  --av-surface-3: #eeeef2;
  --av-line: #e3e3e8;
  --av-line-soft: #edeef1;
  --av-muted: #8a8a95;
  --av-text: #0a0a0b;
  --av-text-dim: #4f4f5a;
  --av-white: #ffffff;
  --av-code-bg: #f1f2f5;
  --av-shadow-deep: rgba(15, 15, 20, 0.12);
  --av-scrollbar: #d4d4dc;
  --av-scrollbar-hover: #b0b0ba;
  --av-glow-a: rgba(255, 56, 63, 0.08);
  --av-glow-b: rgba(255, 56, 63, 0.04);
  --av-overlay: rgba(20, 20, 30, 0.32);
  --av-backdrop: rgba(20, 20, 30, 0.28);
  --av-hover-tint: rgba(15, 15, 25, 0.04);
  --av-hover-tint-strong: rgba(15, 15, 25, 0.06);
}

html,
body,
.app,
.sidebar,
.main,
.topbar,
.content,
.card,
.timer-card,
.kanban-col,
.job-card,
.var-card,
.deliv-card,
.gantt-wrap,
.drawer,
.palette,
.notif-panel,
.assignee-popover,
.modal,
.comment .bubble,
.comment-composer,
.search,
.nav-item,
.pill,
.role-badge,
.avatar,
.field input,
.field textarea,
.field select {
  transition: background-color 260ms ease, border-color 260ms ease,
    color 220ms ease, box-shadow 260ms ease;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--av-black);
  color: var(--av-text);
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  letter-spacing: -0.005em;
  overflow: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

::selection {
  background: var(--av-red);
  color: #000;
}

/* Scrollbar */
.scroll,
.scroll * {
  scrollbar-width: thin;
  scrollbar-color: var(--av-scrollbar) transparent;
}
.scroll::-webkit-scrollbar,
.scroll *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.scroll::-webkit-scrollbar-thumb,
.scroll *::-webkit-scrollbar-thumb {
  background: var(--av-scrollbar);
  border-radius: 10px;
  border: 2px solid var(--av-ink);
}
.scroll::-webkit-scrollbar-thumb:hover,
.scroll *::-webkit-scrollbar-thumb:hover {
  background: var(--av-scrollbar-hover);
}

/* App shell */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  background: radial-gradient(
      1200px 600px at 85% -10%,
      var(--av-glow-a),
      transparent 60%
    ),
    radial-gradient(900px 500px at -10% 110%, var(--av-glow-b), transparent 60%),
    var(--av-black);
}

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--av-line-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(0, 0, 0, 0) 30%);
  position: relative;
  z-index: 5;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #000;
  border: 1px solid var(--av-line);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 10px;
  background: radial-gradient(
    30% 50% at 50% 50%,
    rgba(255, 56, 63, 0.35),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 400ms ease;
}
.brand:hover .brand-mark::after {
  opacity: 1;
}
.brand-mark img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.brand-mark.brand-mark-image {
  background: transparent;
  padding: 0;
}
.brand-mark.brand-mark-image::after {
  display: none;
}
.brand-mark.brand-mark-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.brand-mark.brand-mark-text {
  background: #000;
}
.brand-mark.brand-mark-text span {
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: -0.03em;
  font-family: "Montserrat", sans-serif;
  z-index: 1;
  position: relative;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--av-text);
}
.brand-sub {
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 4px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}
.nav-section {
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 18px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--av-text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition:
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
  position: relative;
}
.nav-item:hover {
  color: var(--av-text);
  background: var(--av-hover-tint);
}
.nav-item.active {
  color: var(--av-text);
  background: linear-gradient(90deg, rgba(255, 56, 63, 0.1), rgba(255, 56, 63, 0.0));
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--av-red);
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(255, 56, 63, 0.6);
}
.nav-item .count {
  margin-left: auto;
  font-size: 10px;
  background: var(--av-surface-3);
  border-radius: 6px;
  padding: 2px 7px;
  color: var(--av-text-dim);
}

/* Global Timer Card */
.timer-card {
  margin-top: auto;
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(
      180deg,
      rgba(255, 56, 63, 0.07),
      rgba(255, 56, 63, 0.0) 60%
    ),
    var(--av-surface);
  position: relative;
  overflow: hidden;
}
.timer-card .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--av-red);
  box-shadow: 0 0 0 0 rgba(255, 56, 63, 0.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 56, 63, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 56, 63, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 56, 63, 0);
  }
}
.timer-card .label {
  font-size: 10px;
  color: var(--av-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.timer-card .title {
  font-size: 13px;
  color: var(--av-text);
  font-weight: 600;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timer-card .time {
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--av-text);
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.timer-card .actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* Main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--av-line-soft);
  background: color-mix(in srgb, var(--av-ink) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 4;
}

.topbar .crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.crumb {
  color: var(--av-text-dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 220px;
}
.crumb.current {
  color: var(--av-text);
  font-weight: 600;
}
.crumb.link {
  cursor: pointer;
}
.crumb.link:hover {
  color: var(--av-text);
}
.crumb-sep {
  opacity: 0.35;
}

.search {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--av-line);
  border-radius: 9px;
  background: var(--av-surface);
  color: var(--av-text-dim);
  margin-left: auto;
}
.search input {
  flex: 1;
  font-size: 13px;
  color: var(--av-text);
}
.search kbd {
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--av-line);
  border-radius: 5px;
  background: var(--av-code-bg);
  color: var(--av-muted);
  font-family: inherit;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff383f, #7a0f12);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--av-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Content */
.content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px 28px 60px;
}
.content h1 {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.content h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.eyebrow {
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 160ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--av-red);
  color: var(--av-text);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 8px 30px -10px rgba(255, 56, 63, 0.8);
}
.btn-primary:hover {
  background: #ff4e54;
  box-shadow: 0 10px 40px -8px rgba(255, 56, 63, 0.9);
}
.btn-ghost {
  background: var(--av-surface);
  border-color: var(--av-line);
  color: var(--av-text);
}
.btn-ghost:hover {
  background: var(--av-surface-2);
  border-color: #2b2b33;
}
.btn-outline {
  border-color: var(--av-line);
  color: var(--av-text-dim);
  background: transparent;
}
.btn-outline:hover {
  color: var(--av-text);
  border-color: #2e2e36;
  background: var(--av-hover-tint);
}
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--av-line);
  border-radius: 9px;
  background: var(--av-surface);
  color: var(--av-text-dim);
}
.btn-icon:hover {
  color: var(--av-text);
  border-color: #2b2b33;
}
.btn-danger {
  background: transparent;
  color: #ff6b71;
  border-color: transparent;
}
.btn-danger:hover {
  background: rgba(255, 56, 63, 0.09);
}

/* Cards */
.card {
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 14px;
  padding: 18px;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background 200ms ease;
}
.card.hover:hover {
  border-color: #2d2d35;
  background: var(--av-surface-2);
}
.card.accent {
  background: linear-gradient(
      180deg,
      rgba(255, 56, 63, 0.1),
      rgba(255, 56, 63, 0) 50%
    ),
    var(--av-surface);
  border-color: rgba(255, 56, 63, 0.25);
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--av-muted);
  font-weight: 600;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -0.02em;
}
.stat-delta {
  font-size: 11px;
  color: var(--av-text-dim);
  margin-top: 4px;
}
.stat-delta.up {
  color: #23d48b;
}
.stat-delta.down {
  color: #ff6b71;
}

.grid {
  display: grid;
  gap: 18px;
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Projects list */
.project-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.project-card .swatch {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--av-text);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.project-card .meta {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  color: var(--av-muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.project-card::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 200px;
  height: 200px;
  background: radial-gradient(closest-side, rgba(255, 56, 63, 0.2), transparent 70%);
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
}
.project-card:hover::after {
  opacity: 1;
}

/* Progress */
.progress {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--av-surface-3);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff383f, #ff8388);
  border-radius: inherit;
  transition: width 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--av-surface-3);
  border: 1px solid var(--av-line);
  color: var(--av-text-dim);
}
.pill .tick {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.active {
  color: #23d48b;
}
.pill.review {
  color: #f3b150;
}
.pill.planning {
  color: #4d9cff;
}
.pill.done {
  color: #8b8bff;
}
.pill.on-hold {
  color: #ff6b71;
}

.priority {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--av-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.priority.high {
  color: #ff6b71;
}
.priority.med {
  color: #f3b150;
}
.priority.low {
  color: #4d9cff;
}

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  min-width: 1000px;
}
.kanban-col {
  background: var(--av-ink);
  border: 1px solid var(--av-line-soft);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}
.kanban-col.drag-over {
  border-color: rgba(255, 56, 63, 0.55);
  background: linear-gradient(180deg, rgba(255, 56, 63, 0.06), rgba(255, 56, 63, 0)),
    var(--av-ink);
  box-shadow: 0 0 0 1px rgba(255, 56, 63, 0.25), 0 0 40px -10px rgba(255, 56, 63, 0.35);
}

.drop-hint {
  padding: 14px;
  border: 1px dashed #22222a;
  border-radius: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--av-muted);
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease;
}
.drop-hint.over {
  border-color: rgba(255, 56, 63, 0.55);
  color: var(--av-text);
  background: rgba(255, 56, 63, 0.06);
}

.job-card[draggable] {
  cursor: grab;
}
.job-card[draggable]:active {
  cursor: grabbing;
}
.kanban-col h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-text-dim);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-col h3 .chip {
  background: var(--av-surface-3);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  color: var(--av-muted);
}

.job-card {
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 11px;
  padding: 13px 13px 11px;
  cursor: pointer;
  transition: all 160ms ease;
}
.job-card:hover {
  border-color: #2d2d35;
  background: var(--av-surface-2);
  transform: translateY(-1px);
}
.job-card h4 {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--av-text);
}
.job-card p {
  margin: 0;
  font-size: 12px;
  color: var(--av-text-dim);
  line-height: 1.5;
}
.job-card .row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--av-muted);
  font-size: 11px;
  font-weight: 500;
}
.job-card .row .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--av-muted);
  opacity: 0.6;
}

/* Detail layouts */
.detail {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 1100px) {
  .detail {
    grid-template-columns: 1fr;
  }
}

/* Subtasks */
.subtask {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 160ms ease;
  cursor: pointer;
}
.subtask:hover {
  background: var(--av-surface);
  border-color: var(--av-line);
}
.subtask .check {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid var(--av-line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 140ms ease;
}
.subtask.done .check {
  background: var(--av-red);
  border-color: var(--av-red);
  box-shadow: 0 0 20px -4px rgba(255, 56, 63, 0.6);
}
.subtask.done .title {
  color: var(--av-muted);
  text-decoration: line-through;
}
.subtask .title {
  flex: 1;
  color: var(--av-text);
  font-size: 13.5px;
  font-weight: 500;
}
.subtask .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--av-muted);
  font-size: 11px;
}

/* Comments */
.comments {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comment {
  display: flex;
  gap: 12px;
}
.comment .bubble {
  flex: 1;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 11px 14px;
}
.comment .bubble .head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--av-text);
  font-weight: 600;
  margin-bottom: 4px;
}
.comment .bubble .head .time {
  color: var(--av-muted);
  font-weight: 500;
  font-size: 11px;
  margin-left: auto;
}
.comment .bubble .body {
  color: var(--av-text-dim);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.comment .avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.comment-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  border-radius: 12px;
  padding: 10px 10px 10px 14px;
  transition: border-color 160ms ease;
}
.comment-composer:focus-within {
  border-color: rgba(255, 56, 63, 0.4);
  box-shadow: 0 0 0 4px rgba(255, 56, 63, 0.06);
}
.comment-composer textarea {
  flex: 1;
  resize: none;
  min-height: 38px;
  max-height: 140px;
  font-size: 13px;
  padding: 6px 0;
  color: var(--av-text);
}
.comment-composer textarea::placeholder {
  color: var(--av-muted);
}

/* Time entries */
.entry {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--av-line-soft);
  align-items: center;
}
.entry:last-child {
  border-bottom: none;
}
.entry .swatch {
  width: 6px;
  height: 24px;
  border-radius: 3px;
  background: var(--av-red);
}
.entry .title {
  font-size: 13px;
  color: var(--av-text);
  font-weight: 500;
  line-height: 1.2;
}
.entry .sub {
  font-size: 11px;
  color: var(--av-muted);
  margin-top: 2px;
}
.entry .duration {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--av-text);
  font-weight: 600;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--av-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
}
.modal h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}
.modal .hint {
  color: var(--av-muted);
  font-size: 12px;
  margin-bottom: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--av-muted);
}
.field input,
.field textarea,
.field select {
  border: 1px solid var(--av-line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--av-ink);
  color: var(--av-text);
  transition: border-color 140ms ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(255, 56, 63, 0.4);
}
.field .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 140ms ease;
}
.color-swatch.active {
  border-color: var(--av-text);
  transform: scale(1.08);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--av-muted);
}
.empty .icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  color: var(--av-text-dim);
}
.empty h3 {
  font-size: 15px;
  color: var(--av-text);
  margin: 0 0 4px;
  font-weight: 600;
}

/* Utilities */
.row {
  display: flex;
  align-items: center;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.gap-6 {
  gap: 6px;
}
.gap-8 {
  gap: 8px;
}
.gap-10 {
  gap: 10px;
}
.gap-12 {
  gap: 12px;
}
.gap-14 {
  gap: 14px;
}
.gap-18 {
  gap: 18px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-20 {
  margin-top: 20px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mb-14 {
  margin-bottom: 14px;
}
.mb-20 {
  margin-bottom: 20px;
}
.mb-24 {
  margin-bottom: 24px;
}
.flex1 {
  flex: 1;
  min-width: 0;
}
.muted {
  color: var(--av-muted);
}
.dim {
  color: var(--av-text-dim);
}
.text-sm {
  font-size: 12px;
}
.text-xs {
  font-size: 11px;
}
.bold {
  font-weight: 700;
}
.semi {
  font-weight: 600;
}
.divider {
  height: 1px;
  background: var(--av-line-soft);
  margin: 16px 0;
}
.mono {
  font-family: "JetBrains Mono", monospace;
}

/* sparkline */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 38px;
  margin-top: 10px;
}
.spark span {
  display: block;
  width: 6px;
  background: linear-gradient(180deg, #ff383f, #5a1114);
  border-radius: 2px;
  opacity: 0.85;
  transition: height 400ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Toggle tabs */
.tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-surface);
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
}
.tab {
  padding: 7px 13px;
  font-size: 12px;
  border-radius: 7px;
  color: var(--av-text-dim);
  cursor: pointer;
  font-weight: 600;
  transition: all 150ms ease;
  white-space: nowrap;
}
.tab.active {
  background: var(--av-surface-3);
  color: var(--av-text);
}

/* Login */
.login-wrap {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 400px at 80% 10%, var(--av-glow-a), transparent 60%),
    radial-gradient(600px 400px at 10% 90%, var(--av-glow-b), transparent 60%),
    var(--av-black);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 28px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 18px;
  text-align: center;
}
.login-card .logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 14px;
  border: 1px solid var(--av-line);
  display: grid;
  place-items: center;
  background: #000;
}
.login-card .logo img {
  width: 38px;
}
.login-card .logo.login-logo-text {
  background: #000;
  color: #fff;
}
.login-card .logo.login-logo-text span {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.04em;
}
.login-card .logo.login-logo-image {
  background: transparent;
  overflow: hidden;
}
.login-card .logo.login-logo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.login-card h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.login-card p {
  color: var(--av-text-dim);
  font-size: 13px;
  margin: 0 0 22px;
}
.login-card .field input {
  text-align: left;
}

/* Command palette */
.palette-backdrop {
  position: fixed;
  inset: 0;
  background: var(--av-backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
}
.palette {
  width: 100%;
  max-width: 620px;
  background: var(--av-code-bg);
  border: 1px solid var(--av-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 40px 100px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 56, 63, 0.05);
}
.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--av-line-soft);
}
.palette-input input {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--av-text);
  background: transparent;
}
.palette-input input::placeholder {
  color: var(--av-muted);
}
.palette-results {
  max-height: 55vh;
  overflow: auto;
  padding: 6px 6px 8px;
}
.palette-group {
  padding: 10px 12px 4px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 600;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 120ms ease;
}
.palette-item:hover,
.palette-item.active {
  background: var(--av-hover-tint-strong);
}
.palette-item.active {
  background: linear-gradient(90deg, rgba(255, 56, 63, 0.15), rgba(255, 56, 63, 0));
}
.palette-item .ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--av-text);
  flex-shrink: 0;
  background: var(--av-surface-3);
  border: 1px solid var(--av-line);
}
.palette-item .label {
  flex: 1;
  min-width: 0;
  color: var(--av-text);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.palette-item .kind {
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.palette-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--av-line-soft);
  color: var(--av-muted);
  font-size: 11px;
}
.palette-footer .key {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid var(--av-line);
  border-radius: 5px;
  color: var(--av-text-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

/* Notifications */
.notif-wrap {
  position: relative;
}
.bell-btn {
  position: relative;
}
.bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--av-red);
  color: var(--av-text);
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 12px -2px rgba(255, 56, 63, 0.7);
  border: 2px solid var(--av-ink);
  letter-spacing: 0.02em;
}
.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 360px;
  max-height: 70vh;
  overflow: auto;
  background: var(--av-code-bg);
  border: 1px solid var(--av-line);
  border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  z-index: 40;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--av-line-soft);
}
.notif-head .title {
  font-size: 13px;
  font-weight: 700;
}
.notif-head .mark {
  font-size: 11px;
  color: var(--av-text-dim);
  cursor: pointer;
  font-weight: 600;
}
.notif-head .mark:hover {
  color: var(--av-text);
}
.notif-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--av-line-soft);
  align-items: flex-start;
  cursor: pointer;
  transition: background 120ms ease;
}
.notif-row:hover {
  background: var(--av-hover-tint);
}
.notif-row .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--av-red);
  margin-top: 4px;
}
.notif-row.read .dot {
  background: transparent;
}

/* Variations */
.var-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) {
  .var-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .var-grid {
    grid-template-columns: 1fr;
  }
}
.var-card {
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 160ms ease,
    border-color 160ms ease;
}
.var-card:hover {
  transform: translateY(-2px);
  border-color: #2d2d35;
}
.var-card.flagged {
  border-color: rgba(255, 56, 63, 0.4);
  background: linear-gradient(180deg, rgba(255, 56, 63, 0.05), transparent 60%),
    var(--av-surface);
}
.var-card.approved {
  border-color: rgba(35, 212, 139, 0.35);
}
.var-preview {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: var(--av-text);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  overflow: hidden;
}
.var-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px 200px at 50% 100%,
    rgba(0, 0, 0, 0.4),
    transparent 60%
  );
  pointer-events: none;
}
.var-variant {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: var(--av-backdrop);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}
.var-score {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  background: var(--av-backdrop);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  font-family: "JetBrains Mono", monospace;
}
.var-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.var-body h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--av-text);
}
.var-body p {
  margin: 0;
  font-size: 12px;
  color: var(--av-text-dim);
  line-height: 1.5;
}
.compliance-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--av-surface-3);
  overflow: hidden;
}
.compliance-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #23d48b, #4ade80);
}
.compliance-bar.low > span {
  background: linear-gradient(90deg, #ff6b71, #ff383f);
}
.compliance-bar.med > span {
  background: linear-gradient(90deg, #f3b150, #f59e0b);
}

/* Compare modal */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.compare-grid .mid {
  display: grid;
  place-items: center;
  color: var(--av-muted);
}

/* Deliverables */
.deliv-card {
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}
.deliv-card:hover {
  border-color: #2d2d35;
  transform: translateY(-1px);
}
.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: "JetBrains Mono", monospace;
  border: 1px solid transparent;
}
.format-badge.pdf {
  background: rgba(255, 56, 63, 0.12);
  color: #ff6b71;
  border-color: rgba(255, 56, 63, 0.25);
}
.format-badge.png {
  background: rgba(77, 156, 255, 0.12);
  color: #4d9cff;
  border-color: rgba(77, 156, 255, 0.25);
}
.format-badge.jpg {
  background: rgba(243, 177, 80, 0.12);
  color: #f3b150;
  border-color: rgba(243, 177, 80, 0.25);
}
.format-badge.svg {
  background: rgba(35, 212, 139, 0.12);
  color: #23d48b;
  border-color: rgba(35, 212, 139, 0.25);
}

.qa-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qa-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--av-text-dim);
  cursor: pointer;
  padding: 6px 0;
}
.qa-item:hover {
  color: var(--av-text);
}
.qa-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--av-line);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all 140ms ease;
}
.qa-check.done {
  background: #23d48b;
  border-color: #23d48b;
}
.qa-item.done .qa-label {
  color: var(--av-muted);
  text-decoration: line-through;
}

/* Gantt */
.gantt-wrap {
  border: 1px solid var(--av-line);
  border-radius: 14px;
  background: var(--av-surface);
  padding: 0;
  overflow: hidden;
}
.gantt-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--av-line-soft);
}
.gantt-head .gantt-scale {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 600;
}
.gantt-head .gantt-scale > div {
  padding: 12px 14px;
  border-left: 1px solid var(--av-line-soft);
}
.gantt-head .gantt-scale > div:first-child {
  border-left: none;
}
.gantt-head .gantt-label {
  padding: 12px 16px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 600;
  border-right: 1px solid var(--av-line-soft);
}
.gantt-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--av-line-soft);
  min-height: 60px;
}
.gantt-row:last-child {
  border-bottom: none;
}
.gantt-row .gantt-title {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--av-line-soft);
  cursor: pointer;
}
.gantt-row .gantt-title:hover {
  background: var(--av-hover-tint);
}
.gantt-track {
  position: relative;
  padding: 14px;
}
.gantt-bar {
  position: absolute;
  height: 28px;
  border-radius: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--av-text);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: filter 160ms ease;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.gantt-bar:hover {
  filter: brightness(1.15);
}
.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--av-red);
  box-shadow: 0 0 10px rgba(255, 56, 63, 0.6);
  z-index: 2;
  pointer-events: none;
}
.gantt-today::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--av-red);
}

/* Agent drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--av-backdrop);
  z-index: 35;
  backdrop-filter: blur(4px);
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 96vw;
  background: var(--av-ink);
  border-left: 1px solid var(--av-line);
  z-index: 36;
  display: flex;
  flex-direction: column;
  box-shadow: -40px 0 80px -20px rgba(0, 0, 0, 0.6);
}
.drawer-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--av-line-soft);
}
.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 18px 22px 26px;
}
.run-row {
  border: 1px solid var(--av-line);
  border-radius: 11px;
  background: var(--av-surface);
  padding: 14px;
  margin-bottom: 10px;
}
.run-row .run-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--av-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  margin-bottom: 10px;
}
.run-row .io {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--av-text-dim);
  background: var(--av-code-bg);
  border: 1px solid var(--av-line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
}
.run-row .io.out {
  color: #cfcfd6;
}
.run-row .meta {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  color: var(--av-muted);
  font-size: 11px;
  font-weight: 500;
}
.run-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.run-status.success {
  color: #23d48b;
}
.run-status.error {
  color: #ff6b71;
}
.run-status.running {
  color: #4d9cff;
}
.run-status .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
}
.run-status.running .d {
  animation: pulse 1.4s infinite;
}

/* Member stack */
.member-stack {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  cursor: default;
}
.member-stack.clickable {
  cursor: pointer;
  border-radius: 999px;
  transition: background 150ms ease;
}
.member-stack.clickable:hover {
  background: var(--av-hover-tint-strong);
}
.member-stack .avatar {
  border: 2px solid var(--av-ink);
  margin-left: -8px;
}
.member-stack .avatar:first-child {
  margin-left: 0;
}
.member-stack .owner-ring {
  box-shadow: 0 0 0 2px var(--av-red);
}
.member-stack .more-chip {
  margin-left: -8px;
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--av-surface-3);
  border: 2px solid var(--av-ink);
  color: var(--av-text-dim);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 0.02em;
}

/* Assignee picker popover */
.assignee-inline {
  position: relative;
  display: inline-flex;
}
.assignee-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px dashed var(--av-line);
  display: grid;
  place-items: center;
  color: var(--av-muted);
  cursor: pointer;
  background: transparent;
  transition: all 140ms ease;
}
.assignee-btn:hover {
  border-color: var(--av-red);
  color: var(--av-red);
}
.assignee-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 240px;
  max-height: 320px;
  overflow: auto;
  background: var(--av-code-bg);
  border: 1px solid var(--av-line);
  border-radius: 11px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  z-index: 25;
  padding: 6px;
}
.assignee-popover .opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease;
}
.assignee-popover .opt:hover,
.assignee-popover .opt.active {
  background: var(--av-hover-tint-strong);
}
.assignee-popover .opt .name {
  flex: 1;
  font-size: 13px;
  color: var(--av-text);
  font-weight: 500;
}
.assignee-popover .opt .role {
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.assignee-popover .sep {
  height: 1px;
  background: var(--av-line-soft);
  margin: 4px 8px;
}
.assignee-popover .add-member {
  color: var(--av-red);
  font-size: 11.5px;
  font-weight: 600;
  padding: 8px 9px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.04em;
}
.assignee-popover .add-member:hover {
  background: rgba(255, 56, 63, 0.07);
}

/* Role badge */
.role-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--av-surface-3);
  color: var(--av-text-dim);
  border: 1px solid var(--av-line);
}

/* Current user card in settings */
.switcher-card .row-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  cursor: pointer;
  transition: all 140ms ease;
}
.switcher-card .row-member:hover {
  border-color: #2b2b33;
  background: var(--av-surface);
}
.switcher-card .row-member.active {
  border-color: rgba(255, 56, 63, 0.45);
  background: linear-gradient(
      180deg,
      rgba(255, 56, 63, 0.06),
      rgba(255, 56, 63, 0)
    ),
    var(--av-ink);
}
.switcher-card .row-member .info {
  flex: 1;
  min-width: 0;
}
.switcher-card .row-member .info .name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--av-text);
}
.switcher-card .row-member .info .role {
  font-size: 11px;
  color: var(--av-text-dim);
  margin-top: 2px;
}

/* ======== Time Tracking / Calendar ======== */

.timepage {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .timepage {
    grid-template-columns: 1fr;
  }
}

.mywork {
  border: 1px solid var(--av-line);
  border-radius: 14px;
  background: var(--av-surface);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
  overflow: hidden;
  position: sticky;
  top: 70px;
}
.mywork-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--av-line-soft);
}
.mywork-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--av-line);
  border-radius: 8px;
  background: var(--av-ink);
  margin-top: 10px;
}
.mywork-search input {
  flex: 1;
  font-size: 12.5px;
  color: var(--av-text);
}
.mywork-list {
  flex: 1;
  overflow: auto;
  padding: 6px 10px 14px;
}
.mywork-section {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 700;
  padding: 10px 4px 6px;
}
.mywork-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 6px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-ink);
  cursor: grab;
  transition:
    border-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
  user-select: none;
}
.mywork-item:hover {
  border-color: rgba(255, 56, 63, 0.35);
  transform: translateY(-1px);
}
.mywork-item:active {
  cursor: grabbing;
}
.mywork-item.dragging {
  opacity: 0.45;
}
.mywork-item .grip {
  color: var(--av-muted);
}
.mywork-item .swatch {
  width: 4px;
  height: 32px;
  border-radius: 2px;
  background: var(--av-red);
  flex-shrink: 0;
}
.mywork-item .info {
  flex: 1;
  min-width: 0;
}
.mywork-item .info .t {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--av-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mywork-item .info .s {
  font-size: 10.5px;
  color: var(--av-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mywork-item .start {
  border: 1px solid var(--av-line);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--av-red);
  display: grid;
  place-items: center;
  transition: background 140ms ease;
}
.mywork-item .start:hover {
  background: rgba(255, 56, 63, 0.08);
}

/* Calendar main */
.cal-wrap {
  border: 1px solid var(--av-line);
  border-radius: 14px;
  background: var(--av-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--av-line-soft);
  flex-wrap: wrap;
}
.cal-toolbar .title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--av-text);
}
.cal-toolbar .nav-btns {
  display: flex;
  gap: 4px;
}

.cal-grid-wrap {
  overflow: auto;
  max-height: calc(100vh - 200px);
}

/* --- Week + Day shared --- */
.cal-hours {
  display: grid;
  grid-template-rows: repeat(18, 56px);
  border-right: 1px solid var(--av-line-soft);
}
.cal-hours .hr {
  position: relative;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--av-muted);
  padding: 0 8px;
  border-top: 1px solid var(--av-line-soft);
}
.cal-hours .hr span {
  position: absolute;
  top: -7px;
  right: 8px;
  background: var(--av-surface);
  padding: 0 4px;
}
.cal-hours .hr:first-child {
  border-top: none;
}

.cal-day {
  position: relative;
  border-right: 1px solid var(--av-line-soft);
}
.cal-day:last-child {
  border-right: none;
}
.cal-day-head {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--av-muted);
  border-bottom: 1px solid var(--av-line-soft);
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--av-surface);
  z-index: 2;
}
.cal-day-head.today .n {
  background: var(--av-red);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(255, 56, 63, 0.5);
}
.cal-day-head .n {
  font-size: 18px;
  font-weight: 800;
  color: var(--av-text);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  letter-spacing: -0.02em;
}

.cal-slots {
  position: relative;
  display: grid;
  grid-template-rows: repeat(18, 56px);
}
.cal-slot {
  border-top: 1px solid var(--av-line-soft);
  position: relative;
  transition: background 120ms ease;
}
.cal-slot:first-child {
  border-top: none;
}
.cal-slot.drag-over {
  background: rgba(255, 56, 63, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 56, 63, 0.35);
}
.cal-slot.future {
  background: repeating-linear-gradient(
    135deg,
    transparent 0px,
    transparent 8px,
    var(--av-line-soft) 8px,
    var(--av-line-soft) 9px
  );
  opacity: 0.55;
  cursor: not-allowed;
}
.cal-slot.future.drag-over {
  background: repeating-linear-gradient(
    135deg,
    transparent 0px,
    transparent 8px,
    var(--av-line-soft) 8px,
    var(--av-line-soft) 9px
  );
  box-shadow: none;
}
.cal-day.future .cal-slots {
  opacity: 0.85;
}
.cal-day-head.future {
  opacity: 0.5;
}
.cal-day-head.future .n {
  color: var(--av-muted);
}
.cal-month-cell.future {
  opacity: 0.45;
  cursor: not-allowed;
  background: repeating-linear-gradient(
    135deg,
    transparent 0px,
    transparent 10px,
    var(--av-line-soft) 10px,
    var(--av-line-soft) 11px
  );
}
.cal-month-cell.future:hover {
  background: repeating-linear-gradient(
    135deg,
    transparent 0px,
    transparent 10px,
    var(--av-line-soft) 10px,
    var(--av-line-soft) 11px
  );
}

.cal-entry {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 11px;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  z-index: 3;
  transition:
    filter 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cal-entry:hover {
  filter: brightness(1.12);
  transform: translateX(1px);
  z-index: 4;
}
.cal-entry .title {
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-entry .sub {
  font-size: 10px;
  opacity: 0.9;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-entry .dur {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  opacity: 0.85;
  margin-top: 2px;
}
.cal-entry.ghost {
  background: transparent !important;
  border: 1px dashed var(--av-line);
  color: var(--av-text-dim);
  box-shadow: none;
}
.cal-entry.ghost .title {
  color: var(--av-text-dim);
}
.cal-entry.ghost:hover {
  border-color: rgba(255, 56, 63, 0.55);
  color: var(--av-text);
}
.cal-entry.running {
  box-shadow: 0 0 0 2px rgba(255, 56, 63, 0.45),
    0 10px 28px -10px rgba(255, 56, 63, 0.55);
}

.cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--av-red);
  z-index: 5;
  pointer-events: none;
}
.cal-now-line::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--av-red);
  box-shadow: 0 0 14px rgba(255, 56, 63, 0.7);
}

/* Week */
.cal-week {
  display: grid;
  grid-template-columns: 60px repeat(7, minmax(120px, 1fr));
  min-width: 800px;
}
.cal-day-spacer {
  border-bottom: 1px solid var(--av-line-soft);
  background: var(--av-surface);
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Day */
.cal-dayview {
  display: grid;
  grid-template-columns: 60px 1fr;
  min-width: 600px;
}

/* Month */
.cal-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-month-head {
  padding: 10px 12px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--av-line-soft);
  border-right: 1px solid var(--av-line-soft);
  text-align: center;
}
.cal-month-head:last-child {
  border-right: none;
}
.cal-month-cell {
  border-right: 1px solid var(--av-line-soft);
  border-bottom: 1px solid var(--av-line-soft);
  padding: 8px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--av-surface);
  cursor: pointer;
  transition: background 140ms ease;
}
.cal-month-cell:hover {
  background: var(--av-surface-2);
}
.cal-month-cell.drag-over {
  background: rgba(255, 56, 63, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 56, 63, 0.35);
}
.cal-month-cell.muted {
  background: var(--av-ink);
}
.cal-month-cell.muted .n {
  color: var(--av-muted);
}
.cal-month-cell .n {
  font-size: 13px;
  font-weight: 700;
  color: var(--av-text);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.cal-month-cell.today .n {
  background: var(--av-red);
  color: #fff;
}
.cal-month-cell .total {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--av-text-dim);
  font-weight: 600;
  margin-top: auto;
}
.cal-month-cell .mbar-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-month-cell .mbar {
  height: 3px;
  border-radius: 2px;
}

/* Auto-suggest banner */
.track-banner {
  margin-bottom: 14px;
  border: 1px solid rgba(255, 56, 63, 0.35);
  border-radius: 12px;
  background: linear-gradient(
      180deg,
      rgba(255, 56, 63, 0.08),
      rgba(255, 56, 63, 0.02) 60%
    ),
    var(--av-surface);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.track-banner .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--av-red);
  box-shadow: 0 0 12px rgba(255, 56, 63, 0.55);
  flex-shrink: 0;
}
.track-banner .text {
  flex: 1;
  font-size: 13px;
  color: var(--av-text);
  font-weight: 500;
}
.track-banner .text strong {
  font-weight: 700;
}
.track-banner .sub {
  font-size: 11px;
  color: var(--av-text-dim);
  margin-top: 2px;
}

/* Idle prompt */
.idle-modal {
  max-width: 460px;
}
.idle-meta {
  display: flex;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-ink);
  margin-bottom: 14px;
}
.idle-meta .label {
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.idle-meta .val {
  font-size: 15px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  color: var(--av-text);
}

/* ======== Access Control ======== */

.access-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.access-row {
  display: grid;
  grid-template-columns: 240px 1fr 1fr;
  gap: 22px;
  align-items: flex-start;
  padding: 18px;
}
@media (max-width: 1100px) {
  .access-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
.access-row.admin {
  border-color: rgba(255, 56, 63, 0.3);
  background: linear-gradient(
      180deg,
      rgba(255, 56, 63, 0.04),
      rgba(255, 56, 63, 0) 60%
    ),
    var(--av-surface);
}

.access-col .col-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.page-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  color: var(--av-text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}
.page-pill:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.page-pill.on {
  color: #23d48b;
  border-color: rgba(35, 212, 139, 0.35);
  background: rgba(35, 212, 139, 0.08);
}
.page-pill.off {
  color: #ff6b71;
  border-color: rgba(255, 56, 63, 0.35);
  background: rgba(255, 56, 63, 0.08);
}
.page-pill.default {
  opacity: 0.75;
}

.client-picker .client-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.client-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  color: var(--av-text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
}
.client-chip:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--av-text);
}
.client-chip.active {
  color: var(--av-text);
}
.client-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.chip-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  color: var(--av-text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 140ms ease;
}
.chip-btn:hover {
  color: var(--av-text);
  border-color: rgba(255, 255, 255, 0.15);
}
.chip-btn.on {
  color: var(--av-red);
  border-color: rgba(255, 56, 63, 0.35);
  background: rgba(255, 56, 63, 0.08);
}

/* ======== Mentions ======== */

.mention {
  display: inline-flex;
  align-items: baseline;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 56, 63, 0.12);
  color: var(--av-red);
  font-weight: 600;
  font-size: 12.5px;
  border: 1px solid rgba(255, 56, 63, 0.25);
  cursor: default;
  white-space: nowrap;
  line-height: 1.35;
  margin: 0 1px;
}

.comment.mentions-me .bubble {
  border-color: rgba(255, 56, 63, 0.35);
  background: linear-gradient(
      180deg,
      rgba(255, 56, 63, 0.06),
      rgba(255, 56, 63, 0) 60%
    ),
    var(--av-surface);
  box-shadow: 0 0 0 1px rgba(255, 56, 63, 0.12),
    0 0 32px -12px rgba(255, 56, 63, 0.35);
}

.mention-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--av-red);
  background: rgba(255, 56, 63, 0.1);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255, 56, 63, 0.28);
}

.mention-picker {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px);
  min-width: 260px;
  max-width: 320px;
  background: #0b0b0d;
  border: 1px solid var(--av-line);
  border-radius: 12px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  padding: 6px;
  z-index: 30;
}
[data-theme="light"] .mention-picker {
  background: var(--av-ink);
}
.mention-picker .picker-head {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 700;
  padding: 8px 10px 6px;
}
.mention-picker .opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease;
}
.mention-picker .opt:hover,
.mention-picker .opt.active {
  background: rgba(255, 56, 63, 0.1);
}
.mention-picker .opt .name {
  flex: 1;
  font-size: 13px;
  color: var(--av-text);
  font-weight: 500;
}
.mention-picker .opt .role {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 700;
}

/* Notification mention highlight */
.notif-row.mention {
  background: linear-gradient(
    90deg,
    rgba(255, 56, 63, 0.06),
    rgba(255, 56, 63, 0) 70%
  );
}
.notif-row.mention .dot {
  background: var(--av-red);
  box-shadow: 0 0 10px rgba(255, 56, 63, 0.5);
}
.mention-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--av-red);
  background: rgba(255, 56, 63, 0.1);
  border: 1px solid rgba(255, 56, 63, 0.3);
}

/* ======== Compliance: Daily Targets & Block ======== */

.targets-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.targets-strip.compact .target-ring {
  width: 32px;
  height: 32px;
}
.targets-strip.compact .target-ring .letter {
  font-size: 10px;
}

.target-ring {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.target-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.target-ring .track {
  stroke: var(--av-surface-3);
  fill: none;
}
.target-ring .arc {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 420ms ease, stroke 220ms ease;
}
.target-ring .letter {
  position: relative;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--av-text);
  font-family: "Montserrat", sans-serif;
  z-index: 1;
}
.target-ring.state-complete .arc {
  stroke: #23d48b;
}
.target-ring.state-today .arc {
  stroke: var(--av-red);
}
.target-ring.state-today .letter {
  color: var(--av-red);
}
.target-ring.state-missed .arc {
  stroke: var(--av-red);
}
.target-ring.state-missed::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 56, 63, 0.55);
  animation: miss-pulse 2.6s ease-in-out infinite;
}
.target-ring.state-future .arc {
  stroke: transparent;
}
.target-ring.state-future .letter {
  color: var(--av-muted);
}

@keyframes miss-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

.target-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--av-text);
  font-weight: 500;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5);
}
.target-ring:hover .target-tooltip {
  opacity: 1;
}

.week-total {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.week-total .label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 700;
}
.week-total .value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--av-text);
  margin-top: 4px;
  font-family: "Montserrat", sans-serif;
}
.week-total .value.low {
  color: var(--av-red);
}

/* Topbar compact version */
.topbar-targets {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
}
.topbar-targets .mini-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 700;
  margin-right: 4px;
}
.topbar-targets .mini-total {
  font-size: 11px;
  font-weight: 700;
  color: var(--av-text);
  margin-left: 4px;
  font-family: "JetBrains Mono", monospace;
}
.topbar-targets .mini-total.low {
  color: var(--av-red);
}
@media (max-width: 980px) {
  .topbar-targets {
    display: none;
  }
}

/* Dashboard week card */
.week-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
.week-card.blocked {
  border-color: rgba(255, 56, 63, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 56, 63, 0.25),
    0 20px 50px -20px rgba(255, 56, 63, 0.35);
}
.week-card .right-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  padding-left: 22px;
  border-left: 1px solid var(--av-line-soft);
}
.week-card .right-stats .stat-label {
  margin-bottom: 6px;
}
@media (max-width: 820px) {
  .week-card {
    grid-template-columns: 1fr;
  }
  .week-card .right-stats {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--av-line-soft);
    padding-top: 16px;
  }
}

/* Lock banner on Time tracking */
.lock-banner {
  border: 1px solid rgba(255, 56, 63, 0.45);
  border-radius: 14px;
  background: linear-gradient(
      180deg,
      rgba(255, 56, 63, 0.1),
      rgba(255, 56, 63, 0) 60%
    ),
    var(--av-surface);
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.lock-banner .icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 56, 63, 0.15);
  color: var(--av-red);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 28px -6px rgba(255, 56, 63, 0.45);
}
.lock-banner h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.lock-banner p {
  margin: 4px 0 12px;
  color: var(--av-text-dim);
  font-size: 13px;
  line-height: 1.5;
}
.lock-banner .missed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.lock-banner .missed-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 56, 63, 0.3);
  background: rgba(255, 56, 63, 0.06);
  color: var(--av-text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 140ms ease, border-color 140ms ease;
}
.lock-banner .missed-chip:hover {
  background: rgba(255, 56, 63, 0.12);
  border-color: rgba(255, 56, 63, 0.55);
}
.lock-banner .missed-chip .mono {
  color: var(--av-red);
}

/* Sidebar lock indicators */
.nav-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.nav-item.locked:hover {
  background: transparent;
  color: var(--av-text-dim);
}
.nav-item.locked .lock-ico {
  margin-left: auto;
  color: var(--av-red);
  opacity: 0.85;
}

/* iOS-style toggle switch */
.toggle-switch {
  width: 34px;
  height: 20px;
  border-radius: 12px;
  background: var(--av-surface-3);
  border: 1px solid var(--av-line);
  position: relative;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 180ms ease;
}
.toggle-switch.on {
  background: var(--av-red);
  border-color: var(--av-red);
}
.toggle-switch.on::after {
  left: 15px;
}

/* Team compliance rows */
.compliance-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-ink);
  margin-bottom: 8px;
}
.compliance-row .start-input {
  font-size: 11.5px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  color: var(--av-text);
  color-scheme: light dark;
  font-family: "JetBrains Mono", monospace;
}
.compliance-row .start-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--av-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.compliance-row .start-cell {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}
@media (max-width: 900px) {
  .compliance-row {
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }
  .compliance-row > :nth-child(n + 3) {
    grid-column: 1 / -1;
  }
}
.compliance-row .info .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--av-text);
}
.compliance-row .info .role {
  font-size: 11px;
  color: var(--av-muted);
  margin-top: 2px;
}
.compliance-row .c-status {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--av-line);
}
.compliance-row .c-status.compliant {
  color: #23d48b;
  border-color: rgba(35, 212, 139, 0.3);
  background: rgba(35, 212, 139, 0.08);
}
.compliance-row .c-status.grace {
  color: #f3b150;
  border-color: rgba(243, 177, 80, 0.35);
  background: rgba(243, 177, 80, 0.08);
}
.compliance-row .c-status.blocked {
  color: var(--av-red);
  border-color: rgba(255, 56, 63, 0.4);
  background: rgba(255, 56, 63, 0.08);
}

/* Appearance tiles */
.theme-tile {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--av-line);
  border-radius: 12px;
  background: var(--av-ink);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}
.theme-tile:hover {
  transform: translateY(-2px);
}
.theme-tile.active {
  border-color: rgba(255, 56, 63, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 56, 63, 0.25),
    0 20px 40px -20px rgba(255, 56, 63, 0.35);
}
.theme-preview {
  height: 78px;
  border-radius: 8px;
  border: 1px solid var(--av-line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.theme-preview.dark {
  background: radial-gradient(
      140px 70px at 90% -10%,
      rgba(255, 56, 63, 0.25),
      transparent 60%
    ),
    #0a0a0b;
  color: #fff;
}
.theme-preview.light {
  background: radial-gradient(
      140px 70px at 90% -10%,
      rgba(255, 56, 63, 0.15),
      transparent 60%
    ),
    #ffffff;
  border-color: #e3e3e8;
}
.theme-preview .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--av-red);
}
.theme-preview .bar {
  height: 8px;
  border-radius: 4px;
  width: 75%;
}
.theme-preview.dark .bar {
  background: #2a2a30;
}
.theme-preview.light .bar {
  background: #e6e6ec;
}
.theme-preview .bar.short {
  width: 45%;
}

/* Fade-in animations handled by framer-motion */
.hero-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
@media (max-width: 720px) {
  .hero-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .hero-header > .row,
  .hero-header > div:last-child {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .content {
    padding: 20px 16px 44px;
  }
  .content h1 {
    font-size: 25px;
  }
}

/* Toolbar for projects page */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* Projects controls */
.projects-control-panel {
  border: 1px solid var(--av-line);
  border-radius: 14px;
  background: var(--av-surface);
  padding: 14px;
  margin-bottom: 18px;
}
.projects-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--av-line-soft);
}
.project-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-top: 12px;
}
.project-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.project-control-label {
  flex-shrink: 0;
  color: var(--av-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.project-status-tabs,
.project-view-tabs {
  max-width: 100%;
  overflow-x: auto;
}
.project-status-tabs .tab,
.project-view-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
}
.project-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.project-search {
  min-width: 240px;
}
.project-clear-filters {
  padding-inline: 11px;
}
@media (max-width: 980px) {
  .projects-control-head,
  .project-filter-grid {
    grid-template-columns: 1fr;
  }
  .projects-control-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .project-filters {
    justify-content: flex-start;
  }
  .project-control-group {
    align-items: flex-start;
    flex-direction: column;
  }
  .project-filter-group {
    width: 100%;
  }
  .project-search {
    min-width: min(100%, 280px);
  }
}
@media (max-width: 620px) {
  .projects-control-panel {
    padding: 12px;
  }
  .project-filters,
  .project-filters .filter-select,
  .project-search {
    width: 100%;
  }
  .project-view-tabs,
  .project-status-tabs {
    width: 100%;
  }
}

/* Scroll container for kanban */
.scroll-x {
  overflow-x: auto;
  padding-bottom: 8px;
}

/* Switch */
.link {
  color: var(--av-text);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
}
.link:hover {
  border-color: var(--av-red);
  color: var(--av-red);
}

/* --------------------------- Job tabs --------------------------- */
.job-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  width: fit-content;
  margin-bottom: 20px;
}
.job-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--av-text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.job-tab:hover {
  color: var(--av-text);
}
.job-tab.active {
  background: var(--av-surface);
  color: var(--av-text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}
.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 6px;
  height: 18px;
  border-radius: 9px;
  background: var(--av-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* --------------------------- Job files list --------------------------- */
.job-files-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.job-file-row {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.job-file-row:hover {
  border-color: var(--av-red);
  transform: translateX(2px);
}
.job-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  display: grid;
  place-items: center;
  color: var(--av-text-dim);
  flex-shrink: 0;
}
.job-file-preview {
  color: var(--av-text-dim);
  font-size: 12.5px;
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.job-file-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* --------------------------- Chatbot page --------------------------- */
.chat-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  height: calc(100vh - 140px);
  min-height: 520px;
}
.chat-rail {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}
.chat-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-rail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.chat-rail-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--av-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chat-rail-item:hover {
  border-color: var(--av-line);
}
.chat-rail-item.active {
  border-color: var(--av-red);
  background: color-mix(in srgb, var(--av-red) 10%, var(--av-surface));
}

.chat-main {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 40px;
  color: var(--av-text-dim);
}
.chat-empty h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--av-text);
}

.chat-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.chat-ref-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--av-line-soft);
  background: var(--av-surface);
  position: relative;
}
.chat-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--av-text);
  max-width: 240px;
}
.chat-ref-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.chat-ref-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--av-text-dim);
  cursor: pointer;
  padding: 0;
}
.chat-ref-x:hover {
  background: var(--av-line);
  color: var(--av-red);
}
.chat-ref-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: transparent;
  border: 1px dashed var(--av-line);
  border-radius: 999px;
  color: var(--av-text-dim);
  font-size: 12px;
  cursor: pointer;
}
.chat-ref-add:hover {
  border-color: var(--av-red);
  color: var(--av-red);
}
.chat-ref-picker {
  position: absolute;
  top: calc(100% - 2px);
  left: 16px;
  width: 340px;
  max-width: calc(100% - 32px);
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  z-index: 12;
  overflow: hidden;
}
.chat-ref-picker-list {
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}
.chat-ref-picker-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.chat-ref-picker-item:hover {
  background: var(--av-ink);
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-starter {
  text-align: center;
  color: var(--av-text-dim);
  padding: 40px 20px;
  margin: auto;
  max-width: 420px;
}
.chat-msg {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-msg.user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--av-red) 16%, var(--av-surface));
  border-color: color-mix(in srgb, var(--av-red) 32%, var(--av-line));
}
.chat-msg.assistant {
  align-self: flex-start;
}
.chat-msg.error {
  border-color: var(--av-red);
  background: color-mix(in srgb, var(--av-red) 8%, var(--av-surface));
}
.chat-msg.pending {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  align-self: flex-start;
  color: var(--av-text-dim);
}
.chat-msg-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.chat-msg-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--av-text-dim);
}
.chat-msg-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--av-text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  position: relative;
}
.chat-msg-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  color: var(--av-text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.chat-msg-btn:hover {
  border-color: var(--av-red);
  color: var(--av-red);
}
.chat-msg-btn.primary {
  background: color-mix(in srgb, var(--av-red) 18%, var(--av-ink));
  border-color: color-mix(in srgb, var(--av-red) 36%, var(--av-line));
  color: var(--av-text);
}

.chat-save-wrap {
  position: relative;
}
.chat-save-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  z-index: 12;
}

.chat-composer {
  border-top: 1px solid var(--av-line-soft);
  padding: 14px 16px 16px;
  background: var(--av-surface);
}
.chat-input {
  flex: 1;
  resize: vertical;
  min-height: 40px;
  max-height: 200px;
  padding: 10px 12px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 10px;
  color: var(--av-text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  outline: none;
}
.chat-input:focus {
  border-color: var(--av-red);
}
.chat-error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--av-red);
  font-size: 12px;
  margin-bottom: 8px;
}

.spin {
  animation: chatbot-spin 1s linear infinite;
}
@keyframes chatbot-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------- AI assistant card --------------------------- */
.ai-card .provider-seg {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  color: var(--av-text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ai-card .provider-seg:hover {
  color: var(--av-text);
}
.ai-card .provider-seg.active {
  border-color: var(--av-red);
  color: var(--av-text);
  background: color-mix(in srgb, var(--av-red) 12%, var(--av-ink));
}
.pill.danger {
  background: color-mix(in srgb, var(--av-red) 16%, transparent);
  color: var(--av-red);
  border-color: color-mix(in srgb, var(--av-red) 40%, transparent);
}

/* --------------------------- Image messages + image files --------------------------- */
.chat-msg-image {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 480px;
  border-radius: 10px;
  border: 1px solid var(--av-line);
  margin-top: 4px;
  background: #000;
}
.chat-msg-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--av-red) 18%, var(--av-ink));
  border: 1px solid color-mix(in srgb, var(--av-red) 36%, var(--av-line));
  color: var(--av-text);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 999px;
  color: var(--av-text-dim);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.mode-toggle:hover {
  color: var(--av-text);
  border-color: var(--av-line);
}
.mode-toggle.active {
  background: color-mix(in srgb, var(--av-red) 18%, var(--av-ink));
  border-color: color-mix(in srgb, var(--av-red) 50%, var(--av-line));
  color: var(--av-text);
}

.job-file-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--av-line);
  background: #000;
  flex-shrink: 0;
}
.job-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-file-preview {
  border: 1px solid var(--av-line);
  border-radius: 12px;
  background: #000;
  padding: 12px;
  display: grid;
  place-items: center;
  max-height: 60vh;
  overflow: auto;
}
.image-file-preview img {
  max-width: 100%;
  max-height: 56vh;
  display: block;
  border-radius: 8px;
}

.ai-divider {
  height: 1px;
  background: var(--av-line-soft);
  margin: 18px 0;
}

/* --------------------------- Skills (slash + settings card) --------------------------- */
.composer-wrap {
  position: relative;
}
.skill-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  padding: 6px;
  max-height: 320px;
  overflow: auto;
  z-index: 14;
}
.skill-popover-head {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--av-line-soft);
  margin-bottom: 4px;
}
.skill-popover-item {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.skill-popover-item:hover,
.skill-popover-item.active {
  background: var(--av-ink);
  border-color: color-mix(in srgb, var(--av-red) 30%, var(--av-line));
}
.skill-slug {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--av-red);
  background: color-mix(in srgb, var(--av-red) 12%, var(--av-ink));
  border: 1px solid color-mix(in srgb, var(--av-red) 30%, var(--av-line));
  padding: 2px 7px;
  border-radius: 6px;
}
.skill-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--av-text);
}
.skill-mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  color: var(--av-text-dim);
}
.skill-mode-tag.template {
  color: #8ed1ff;
  border-color: rgba(142, 209, 255, 0.35);
  background: rgba(142, 209, 255, 0.12);
}
.skill-mode-tag.persona {
  color: #c9a3ff;
  border-color: rgba(201, 163, 255, 0.35);
  background: rgba(201, 163, 255, 0.12);
}
.skill-mode-tag.sop {
  color: #ffc16a;
  border-color: rgba(255, 193, 106, 0.35);
  background: rgba(255, 193, 106, 0.14);
}

.skill-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  color: var(--av-text);
}
.skill-pill.persona {
  background: rgba(201, 163, 255, 0.12);
  border-color: rgba(201, 163, 255, 0.4);
}
.skill-pill.sop {
  background: rgba(255, 193, 106, 0.12);
  border-color: rgba(255, 193, 106, 0.4);
}
.skill-pill strong {
  font-weight: 700;
}
.skill-pill-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--av-text-dim);
  cursor: pointer;
  padding: 0;
}
.skill-pill-x:hover {
  background: var(--av-line);
  color: var(--av-red);
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--av-line);
  border-radius: 12px;
  background: var(--av-ink);
}
.skill-row.disabled {
  opacity: 0.55;
}
.skill-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  color: var(--av-text-dim);
  flex-shrink: 0;
}

/* AI test result — full-text error display */
.ai-test-result {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  max-width: 100%;
}
.ai-test-result pre {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--av-text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}
.ai-test-result.ok {
  border-color: rgba(80, 200, 120, 0.4);
  background: rgba(80, 200, 120, 0.08);
  color: #7ddb9a;
}
.ai-test-result.err {
  border-color: color-mix(in srgb, var(--av-red) 50%, var(--av-line));
  background: color-mix(in srgb, var(--av-red) 10%, var(--av-ink));
  color: var(--av-red);
}

/* Model list browser */
.model-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  max-height: 320px;
  overflow: auto;
  width: 100%;
}
.model-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
}
.model-pick {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--av-text);
  font-family: inherit;
}
.model-pick:hover {
  border-color: var(--av-red);
}

/* --------------------------- Chat model picker --------------------------- */
.model-picker-wrap {
  position: relative;
  flex-shrink: 0;
}
.model-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 999px;
  color: var(--av-text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  max-width: 260px;
}
.model-picker-btn:hover {
  border-color: var(--av-red);
}
.model-picker-btn.override {
  background: color-mix(in srgb, var(--av-red) 14%, var(--av-ink));
  border-color: color-mix(in srgb, var(--av-red) 40%, var(--av-line));
}
.model-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.model-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 300px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  z-index: 20;
}
.model-picker-head {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px 8px;
  border-bottom: 1px solid var(--av-line-soft);
}
.model-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.model-picker-item:hover {
  background: var(--av-ink);
}
.model-picker-item.active {
  background: var(--av-ink);
  border-color: color-mix(in srgb, var(--av-red) 30%, var(--av-line));
}
.model-picker-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--av-line-soft);
  margin-top: 4px;
}

/* --------------------------- Chat files column --------------------------- */
.chat-page.with-files {
  grid-template-columns: 240px 1fr 300px;
}
.chat-files-col {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}
.chat-files-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--av-line-soft);
}
.chat-files-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 8px;
  color: var(--av-text-dim);
}
.chat-files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-file-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--av-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.chat-file-row:hover {
  border-color: color-mix(in srgb, var(--av-red) 30%, var(--av-line));
  transform: translateX(-2px);
}
.chat-file-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--av-line);
  flex-shrink: 0;
}
.chat-file-thumb.icon {
  display: grid;
  place-items: center;
  background: var(--av-ink);
  color: var(--av-text-dim);
}
.chat-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --------------------------- Activity page --------------------------- */
.activity-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: flex-start;
}
.activity-rail {
  padding: 16px;
  position: sticky;
  top: 16px;
}
.activity-users {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.activity-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.activity-user-row:hover {
  background: var(--av-ink);
}
.activity-user-row.active {
  background: var(--av-ink);
  border-color: color-mix(in srgb, var(--av-red) 30%, var(--av-line));
}
.activity-main {
  min-width: 0;
}

.cal-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 0;
}
.cal-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  column-gap: 3px;
  padding-left: 24px;
}
.cal-month {
  font-size: 9.5px;
  color: var(--av-text-dim);
  font-family: "JetBrains Mono", monospace;
}
.cal-body {
  display: flex;
  gap: 6px;
}
.cal-days {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  row-gap: 3px;
  font-size: 9.5px;
  color: var(--av-text-dim);
  font-family: "JetBrains Mono", monospace;
  width: 18px;
  align-items: center;
}
.cal-weeks { display: flex; gap: 3px; }
.cal-week { display: flex; flex-direction: column; gap: 3px; }
.heatmap-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--av-ink);
  border: 1px solid var(--av-line-soft);
}
.heatmap-cell.pad {
  opacity: 0;
  border-color: transparent;
}
.heatmap-cell.level-0 {
  background: var(--av-ink);
}
.heatmap-cell.level-1 {
  background: color-mix(in srgb, var(--av-red) 25%, var(--av-ink));
  border-color: color-mix(in srgb, var(--av-red) 30%, var(--av-line));
}
.heatmap-cell.level-2 {
  background: color-mix(in srgb, var(--av-red) 45%, var(--av-ink));
  border-color: color-mix(in srgb, var(--av-red) 50%, var(--av-line));
}
.heatmap-cell.level-3 {
  background: color-mix(in srgb, var(--av-red) 70%, var(--av-ink));
  border-color: color-mix(in srgb, var(--av-red) 70%, var(--av-line));
}
.heatmap-cell.level-4 {
  background: var(--av-red);
  border-color: var(--av-red);
}
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}

.hour-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hour-grid-row {
  display: grid;
  grid-template-columns: 24px repeat(24, 1fr);
  gap: 3px;
  align-items: center;
}
.hour-label,
.day-label {
  font-size: 9.5px;
  color: var(--av-text-dim);
  text-align: center;
  font-family: "JetBrains Mono", monospace;
}
.day-label {
  font-weight: 700;
}
.hour-cell {
  height: 14px;
  border-radius: 2px;
  background: var(--av-ink);
  border: 1px solid var(--av-line-soft);
}
.hour-cell.level-0 { background: var(--av-ink); }
.hour-cell.level-1 { background: color-mix(in srgb, var(--av-red) 22%, var(--av-ink)); }
.hour-cell.level-2 { background: color-mix(in srgb, var(--av-red) 42%, var(--av-ink)); }
.hour-cell.level-3 { background: color-mix(in srgb, var(--av-red) 65%, var(--av-ink)); }
.hour-cell.level-4 { background: var(--av-red); }

.page-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.page-bar-row .row {
  margin-bottom: 4px;
}
.page-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--av-ink);
  overflow: hidden;
}
.page-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--av-red), color-mix(in srgb, var(--av-red) 60%, #fff));
  border-radius: 4px;
  transition: width 0.3s ease;
}

@media (max-width: 980px) {
  .activity-grid { grid-template-columns: 1fr; }
  .activity-rail { position: static; }
}

/* Activity KPIs */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  padding: 14px 16px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-card .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--av-text-dim);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-card .value {
  font-size: 20px;
  font-weight: 800;
  color: var(--av-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* Entity kind tags */
.entity-kind-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  color: var(--av-text-dim);
  flex-shrink: 0;
}
.entity-kind-tag.job {
  color: #ffb063;
  border-color: rgba(255, 176, 99, 0.35);
  background: rgba(255, 176, 99, 0.12);
}
.entity-kind-tag.project {
  color: #8ed1ff;
  border-color: rgba(142, 209, 255, 0.35);
  background: rgba(142, 209, 255, 0.12);
}
.entity-kind-tag.subtask {
  color: #c9a3ff;
  border-color: rgba(201, 163, 255, 0.35);
  background: rgba(201, 163, 255, 0.12);
}
.entity-kind-tag.client {
  color: #7ddb9a;
  border-color: rgba(125, 219, 154, 0.35);
  background: rgba(125, 219, 154, 0.12);
}

/* Sessions timeline */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.session-day-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.session-day-head {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--av-text-dim);
  font-weight: 700;
}
.session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 10px;
}
.session-entity {
  font-size: 13px;
  font-weight: 600;
  color: var(--av-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* --------------------------- Finance / AI budgets --------------------------- */
.budget-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  font-size: 12px;
  color: var(--av-text-dim);
}
.budget-bar.ok { border-color: var(--av-line); }
.budget-bar.warning {
  background: rgba(255, 193, 106, 0.1);
  border-color: rgba(255, 193, 106, 0.4);
  color: #ffc16a;
}
.budget-bar.blocked {
  background: color-mix(in srgb, var(--av-red) 14%, var(--av-ink));
  border-color: color-mix(in srgb, var(--av-red) 50%, var(--av-line));
  color: var(--av-red);
}
.budget-bar-track {
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.budget-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--av-red), color-mix(in srgb, var(--av-red) 60%, #fff));
  transition: width 0.3s ease;
}
.budget-bar.ok .budget-bar-fill {
  background: linear-gradient(90deg, #7ddb9a, #5ea878);
}
.budget-bar.warning .budget-bar-fill {
  background: linear-gradient(90deg, #ffc16a, #ff9c3a);
}

.chat-cost-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(125, 219, 154, 0.12);
  border: 1px solid rgba(125, 219, 154, 0.35);
  color: #7ddb9a;
  font-size: 10px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
}

.ai-cost-pill {
  background: rgba(125, 219, 154, 0.12);
  border-color: rgba(125, 219, 154, 0.35);
  color: #7ddb9a;
}

.finance-users {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.finance-user-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
}
.finance-budget-input {
  width: 72px;
  padding: 5px 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 7px;
  color: var(--av-text);
  text-align: right;
  outline: none;
}
.finance-budget-input:focus {
  border-color: var(--av-red);
}
.finance-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.finance-bar.ok .finance-bar-fill {
  background: linear-gradient(90deg, #7ddb9a, #5ea878);
}
.finance-bar.warning .finance-bar-fill {
  background: linear-gradient(90deg, #ffc16a, #ff9c3a);
}
.finance-bar.blocked .finance-bar-fill {
  background: linear-gradient(90deg, var(--av-red), #7a0f12);
}
.finance-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.budget-pct {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
}
.budget-pct.warning {
  background: rgba(255, 193, 106, 0.14);
  border-color: rgba(255, 193, 106, 0.4);
  color: #ffc16a;
}
.budget-pct.blocked {
  background: color-mix(in srgb, var(--av-red) 16%, transparent);
  border-color: color-mix(in srgb, var(--av-red) 40%, transparent);
  color: var(--av-red);
}
.budget-pct.ok {
  background: rgba(125, 219, 154, 0.12);
  border-color: rgba(125, 219, 154, 0.35);
  color: #7ddb9a;
}

.finance-months {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-items: end;
  padding-top: 20px;
  height: 180px;
}
.finance-month-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
}
.finance-month-value {
  font-size: 10px;
  color: var(--av-text-dim);
  font-family: "JetBrains Mono", monospace;
}
.finance-month-bar {
  width: 60%;
  max-width: 40px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--av-red), color-mix(in srgb, var(--av-red) 60%, transparent));
  min-height: 4px;
}
.finance-month-label {
  font-size: 10.5px;
  color: var(--av-text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --------------------------- Sidebar Settings submenu --------------------------- */
.nav-item.nav-item-with-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
}
.nav-item.nav-item-with-toggle .nav-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 8px 10px;
  cursor: pointer;
  min-width: 0;
}
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  background: transparent;
  border: none;
  color: var(--av-text-dim);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--av-text);
}
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 4px 14px;
  padding-left: 10px;
  border-left: 1px solid var(--av-line-soft);
}
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--av-text-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.nav-sub-item:hover {
  color: var(--av-text);
  background: rgba(255, 255, 255, 0.03);
}
.nav-sub-item.active {
  color: var(--av-text);
  background: color-mix(in srgb, var(--av-red) 14%, transparent);
  border-left: 2px solid var(--av-red);
  margin-left: -2px;
  padding-left: 10px;
}
.nav-sub-item .count {
  margin-left: auto;
  background: var(--av-ink);
  color: var(--av-text-dim);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}
.nav-sub-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Timer card — compact AI budget bar */
.timer-budget {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
}
.timer-budget.warning {
  background: rgba(255, 193, 106, 0.08);
  border-color: rgba(255, 193, 106, 0.35);
}
.timer-budget.blocked {
  background: color-mix(in srgb, var(--av-red) 10%, var(--av-ink));
  border-color: color-mix(in srgb, var(--av-red) 45%, var(--av-line));
}
.timer-budget-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
}
.timer-budget-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--av-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.timer-budget-amount {
  color: var(--av-text);
  font-size: 11.5px;
}
.timer-budget-amount strong {
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
}
.timer-budget.warning .timer-budget-amount strong { color: #ffc16a; }
.timer-budget.blocked .timer-budget-amount strong { color: var(--av-red); }
.timer-budget-track {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.timer-budget-fill {
  height: 100%;
  background: linear-gradient(90deg, #7ddb9a, #5ea878);
  transition: width 0.3s ease;
}
.timer-budget.warning .timer-budget-fill {
  background: linear-gradient(90deg, #ffc16a, #ff9c3a);
}
.timer-budget.blocked .timer-budget-fill {
  background: linear-gradient(90deg, var(--av-red), #7a0f12);
}
.timer-budget-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
}

/* --------------------------- Gantt drag handles --------------------------- */
.gantt-bar {
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.gantt-bar.dragging {
  opacity: 0.9;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6);
}
.gantt-bar-move {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 10px;
  cursor: grab;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-bar.dragging .gantt-bar-move {
  cursor: grabbing;
}
.gantt-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.18);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}
.gantt-handle.left { left: 0; }
.gantt-handle.right { right: 0; }
.gantt-bar:hover .gantt-handle,
.gantt-bar.dragging .gantt-handle {
  opacity: 1;
}
.gantt-bar.readonly {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* --------------------------- Projects list table --------------------------- */
.projects-list-wrap {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  overflow: auto;
}
.projects-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.projects-list-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--av-text-dim);
  border-bottom: 1px solid var(--av-line);
  background: var(--av-ink);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.projects-list-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.projects-list-table th.sortable:hover {
  color: var(--av-text);
}
.projects-list-table th.sortable.active {
  color: var(--av-red);
}
.projects-list-table th.sortable span {
  margin-right: 4px;
}
.projects-list-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.projects-list-row:hover {
  background: color-mix(in srgb, var(--av-red) 6%, transparent);
}
.projects-list-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--av-line-soft);
  color: var(--av-text);
  vertical-align: middle;
}
.project-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* --------------------------- Filters row --------------------------- */
.filters-row {
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  color: var(--av-text-dim);
  min-width: 220px;
}
.filter-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--av-text);
  font-size: 13px;
}
.filter-select {
  padding: 7px 10px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  color: var(--av-text);
  font-size: 13px;
  cursor: pointer;
}

/* --------------------------- Kanban --------------------------- */
.kanban-wrap {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.kanban-col {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.kanban-col.over {
  border-color: var(--av-red);
  background: color-mix(in srgb, var(--av-red) 8%, var(--av-ink));
}
.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--av-line-soft);
}
.kanban-col-body {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 340px);
  min-height: 140px;
}
.kanban-card {
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.kanban-card:hover {
  border-color: color-mix(in srgb, var(--av-red) 40%, var(--av-line));
  transform: translateY(-1px);
}
.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

/* --------------------------- Team assignments board --------------------------- */
.assign-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.assign-lane {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.assign-lane.unassigned {
  border-color: color-mix(in srgb, var(--av-red) 40%, var(--av-line));
  background: color-mix(in srgb, var(--av-red) 5%, var(--av-ink));
}
.assign-lane.over {
  border-color: var(--av-red);
  background: color-mix(in srgb, var(--av-red) 8%, var(--av-ink));
}
.assign-lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--av-line-soft);
  flex-wrap: wrap;
}
.assign-lane-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--av-red) 18%, var(--av-ink));
  border: 1px solid color-mix(in srgb, var(--av-red) 45%, var(--av-line));
  color: var(--av-red);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.assign-lane-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.assign-lane-metrics .metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 48px;
}
.assign-lane-metrics .metric-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 800;
  color: var(--av-text);
}
.assign-lane-metrics .metric-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--av-text-dim);
}
.lane-load-bar {
  width: 80px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.lane-load-fill {
  height: 100%;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, #7ddb9a, #5ea878);
}
.lane-load-fill.high {
  background: linear-gradient(90deg, #ffc16a, #ff9c3a);
}
.lane-load-fill.full {
  background: linear-gradient(90deg, var(--av-red), #7a0f12);
}

.assign-lane-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  min-height: 70px;
}
.assign-lane.over .assign-lane-body {
  outline: 2px dashed color-mix(in srgb, var(--av-red) 60%, transparent);
  outline-offset: -6px;
  border-radius: 10px;
}
.assign-lane-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  color: var(--av-text-dim);
  font-size: 12px;
  font-style: italic;
}

.assign-card {
  width: 220px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: grab;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.assign-card:hover {
  border-color: color-mix(in srgb, var(--av-red) 40%, var(--av-line));
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.5);
}
.assign-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.assign-card.overdue {
  border-color: color-mix(in srgb, var(--av-red) 60%, var(--av-line));
}
.assign-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--av-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.assign-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.assign-card-deadline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--av-text-dim);
  font-family: "JetBrains Mono", monospace;
}
.assign-card-deadline.overdue {
  color: var(--av-red);
  font-weight: 700;
}
.assign-card-deadline.done {
  color: #7ddb9a;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.status-todo { background: #6b6b76; }
.status-dot.status-in_progress { background: #4d9cff; }
.status-dot.status-review { background: #f3b150; }
.status-dot.status-done { background: #23d48b; }

@media (max-width: 900px) {
  .assign-card { width: calc(50% - 4px); }
}

/* --------------------------- Planner --------------------------- */
.planner-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  min-height: calc(100vh - 300px);
}
.planner-grid {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 14px;
  overflow: auto;
  max-height: calc(100vh - 260px);
  position: relative;
}
.planner-grid-inner {
  display: flex;
  min-width: max-content;
}
.planner-hours-col {
  flex-shrink: 0;
  width: 60px;
  position: sticky;
  left: 0;
  background: var(--av-ink);
  border-right: 1px solid var(--av-line);
  z-index: 3;
}
.planner-days-head-spacer {
  height: 72px;
  border-bottom: 1px solid var(--av-line);
  background: var(--av-ink);
}
.planner-hour-label {
  height: 48px;
  padding: 2px 8px 0 8px;
  font-size: 10px;
  color: var(--av-text-dim);
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid var(--av-line-soft);
  box-sizing: border-box;
}
.planner-cols-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.planner-days-head {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--av-ink);
  border-bottom: 1px solid var(--av-line);
  height: 72px;
}
.planner-day-head {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--av-line-soft);
  min-width: 120px;
}
.planner-day-head:first-child { border-left: none; }
.planner-day-head .semi {
  padding: 8px 10px 4px;
  font-size: 12px;
}
.planner-day-head.today .semi {
  color: var(--av-red);
}
.planner-day-users {
  display: flex;
  flex: 1;
  border-top: 1px solid var(--av-line-soft);
}
.planner-user-col-head {
  flex: 1;
  display: grid;
  place-items: center;
  border-left: 1px dashed var(--av-line-soft);
  min-width: 60px;
}
.planner-user-col-head:first-child { border-left: none; }

.planner-body {
  display: flex;
  min-height: calc(15 * 48px);
}
.planner-day {
  display: flex;
  border-left: 1px solid var(--av-line);
  min-width: 120px;
}
.planner-day:first-child { border-left: none; }
.planner-col {
  flex: 1;
  position: relative;
  border-left: 1px dashed var(--av-line-soft);
  min-width: 60px;
  overflow: hidden;
}
.planner-col:first-child { border-left: none; }
.planner-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 48px;
  border-bottom: 1px solid var(--av-line-soft);
}
.planner-row-half {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  border-top: 1px dashed rgba(255, 255, 255, 0.03);
}

.planner-over-ghost {
  position: absolute;
  left: 2px;
  right: 2px;
  background: color-mix(in srgb, var(--av-red) 14%, transparent);
  border: 1px dashed color-mix(in srgb, var(--av-red) 55%, var(--av-line));
  border-radius: 6px;
  pointer-events: none;
  z-index: 1;
}

.planner-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--av-red) 45%, var(--av-line));
  background: color-mix(in srgb, var(--av-red) 16%, var(--av-ink));
  color: var(--av-text);
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.planner-block.block-sub {
  background: color-mix(in srgb, #c9a3ff 18%, var(--av-ink));
  border-color: color-mix(in srgb, #c9a3ff 40%, var(--av-line));
}
.planner-block:hover {
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}
.planner-block.dragging {
  opacity: 0.85;
}
.planner-block-body {
  padding: 6px 8px;
  height: 100%;
  cursor: grab;
  user-select: none;
}
.planner-block.dragging .planner-block-body { cursor: grabbing; }
.planner-block-title {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.planner-block-meta {
  font-size: 10px;
  color: var(--av-text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.planner-block-time {
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  color: var(--av-text-dim);
  margin-top: 3px;
}
.planner-block-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.planner-block:hover .planner-block-x { opacity: 1; }
.planner-block-resize {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
  background: transparent;
}
.planner-block-resize::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1px;
  width: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.planner-block:hover .planner-block-resize::after { opacity: 1; }

.planner-user-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--av-line);
  border-radius: 12px;
  background: var(--av-ink);
  align-items: center;
}
.planner-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  cursor: pointer;
  color: var(--av-text-dim);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.planner-user-chip:hover {
  color: var(--av-text);
}
.planner-user-chip.on {
  background: color-mix(in srgb, var(--av-red) 12%, var(--av-surface));
  border-color: color-mix(in srgb, var(--av-red) 42%, var(--av-line));
  color: var(--av-text);
}

.planner-rail {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 260px);
}
.planner-rail-head {
  padding: 12px 14px 6px;
}
.planner-rail-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 8px;
  padding: 6px 10px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  color: var(--av-text-dim);
}
.planner-rail-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--av-text);
  font-size: 12.5px;
}
.planner-rail-list {
  flex: 1;
  overflow: auto;
  padding: 0 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.planner-task-row {
  padding: 8px 10px;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  border-radius: 8px;
  cursor: grab;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.planner-task-row:hover {
  border-color: color-mix(in srgb, var(--av-red) 38%, var(--av-line));
  transform: translateX(-1px);
}
.planner-task-row:active { cursor: grabbing; }
.planner-task-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 980px) {
  .planner-wrap { grid-template-columns: 1fr; }
  .planner-rail { max-height: 360px; }
}

/* --------------------------- Users list + profile --------------------------- */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
}
.user-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 160px;
}

.profile-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: flex-start;
}
.profile-rail {
  padding: 20px;
  position: sticky;
  top: 16px;
}
.profile-photo {
  display: grid;
  place-items: center;
  padding: 10px 0;
}
.profile-main {
  min-width: 0;
}

.working-hours-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.working-hours-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.working-hours-row input[type="time"],
.working-hours-row input[type="number"] {
  padding: 6px 8px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  color: var(--av-text);
  font-size: 12.5px;
}
.working-hours-row input[disabled] {
  opacity: 0.5;
}

/* Leaves (requests + allowances) */
.leaves-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leave-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 10px;
}
.leave-allowances {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.leave-type-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--av-line-soft);
  border-radius: 8px;
  background: var(--av-ink);
}
.leave-type-row input[type="number"] {
  padding: 4px 8px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 6px;
  color: var(--av-text);
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  text-align: right;
}

/* My leaves card (Timesheet) */
.leaves-card {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.leaves-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.over-budget {
  color: var(--av-red);
}

/* Dashboard approvals card */
.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.approval-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 10px;
}

/* Dashboard action center */
.dash-action-center {
  border: 1px solid var(--av-line);
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 56, 63, 0.06), rgba(255, 56, 63, 0) 42%),
    var(--av-surface);
}
.dash-action-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.dash-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.dash-action-card {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--av-line);
  border-radius: 12px;
  background: var(--av-ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.dash-action-card:hover {
  border-color: rgba(255, 56, 63, 0.38);
  background: var(--av-surface-2);
}
.dash-action-card.warning {
  border-color: rgba(243, 177, 80, 0.36);
}
.dash-action-card.danger {
  border-color: rgba(255, 56, 63, 0.45);
}
.dash-action-card.live .dash-action-icon {
  color: var(--av-red);
  box-shadow: 0 0 0 4px var(--av-red-soft);
}
.dash-action-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  color: var(--av-text);
}
.dash-action-copy {
  flex: 1;
  min-width: 0;
}
.dash-action-title {
  margin-top: 8px;
  color: var(--av-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.dash-action-detail {
  margin-top: 6px;
  color: var(--av-text-dim);
  font-size: 12px;
  line-height: 1.45;
}
.dash-action-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  color: var(--av-text);
  font-size: 12px;
  font-weight: 700;
}
.dash-action-button:hover {
  border-color: rgba(255, 56, 63, 0.42);
  color: var(--av-red);
}
@media (max-width: 1180px) {
  .dash-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .dash-action-head {
    flex-direction: column;
  }
  .dash-action-grid {
    grid-template-columns: 1fr;
  }
}

/* Compliance status pill (reused in profile) */
.c-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  color: var(--av-text-dim);
}
.c-status.ok { color: #7ddb9a; border-color: rgba(125, 219, 154, 0.4); background: rgba(125, 219, 154, 0.12); }
.c-status.warn { color: #ffc16a; border-color: rgba(255, 193, 106, 0.4); background: rgba(255, 193, 106, 0.14); }
.c-status.blocked { color: var(--av-red); border-color: color-mix(in srgb, var(--av-red) 45%, transparent); background: color-mix(in srgb, var(--av-red) 12%, transparent); }
.c-status.admin { color: var(--av-text); border-color: var(--av-line); }

@media (max-width: 980px) {
  .profile-wrap { grid-template-columns: 1fr; }
  .profile-rail { position: static; }
}

/* --------------------------- Research module --------------------------- */
.research-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  height: calc(100vh - 160px);
  min-height: 520px;
}
.research-page.with-sources {
  grid-template-columns: 240px 1fr 300px;
}
.research-main {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.research-session-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--av-line-soft);
}
.research-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}
.research-messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px;
}
.research-msg-prose {
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.research-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  color: var(--av-text-dim);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.research-mode-chip:hover {
  color: var(--av-text);
  border-color: color-mix(in srgb, var(--av-red) 40%, var(--av-line));
}

.research-trace {
  padding: 10px 12px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  border-radius: 10px;
}
.research-trace-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.research-trace-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.research-trace-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: var(--av-text-dim);
}
.trace-step {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  min-width: 74px;
  text-align: center;
}
.trace-step.trace-plan { color: #8ed1ff; border-color: rgba(142, 209, 255, 0.4); background: rgba(142, 209, 255, 0.12); }
.trace-step.trace-retrieve { color: #c9a3ff; border-color: rgba(201, 163, 255, 0.4); background: rgba(201, 163, 255, 0.12); }
.trace-step.trace-synthesize { color: #ffc16a; border-color: rgba(255, 193, 106, 0.4); background: rgba(255, 193, 106, 0.14); }
.trace-step.trace-deliver { color: #7ddb9a; border-color: rgba(125, 219, 154, 0.4); background: rgba(125, 219, 154, 0.14); }

.cite-marker {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  background: color-mix(in srgb, var(--av-red) 15%, var(--av-ink));
  color: var(--av-red);
  border: 1px solid color-mix(in srgb, var(--av-red) 35%, var(--av-line));
  vertical-align: baseline;
  cursor: pointer;
}
.cite-marker:hover { background: color-mix(in srgb, var(--av-red) 25%, var(--av-ink)); }
.cite-marker.tier-A { color: #7ddb9a; background: rgba(125, 219, 154, 0.16); border-color: rgba(125, 219, 154, 0.4); }
.cite-marker.tier-B { color: #8ed1ff; background: rgba(142, 209, 255, 0.16); border-color: rgba(142, 209, 255, 0.4); }
.cite-marker.tier-C { color: #ffc16a; background: rgba(255, 193, 106, 0.16); border-color: rgba(255, 193, 106, 0.4); }
.cite-marker.tier-D { color: var(--av-red); }

.research-rail {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}
.research-rail-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--av-line-soft);
}
.research-rail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.research-source-row {
  display: block;
  padding: 10px;
  border-radius: 10px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.research-source-row:hover {
  border-color: color-mix(in srgb, var(--av-red) 35%, var(--av-line));
}
.research-source-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  color: var(--av-red);
  flex-shrink: 0;
  padding-top: 2px;
}
.research-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.cred-tier {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}
.cred-tier.tier-A { color: #7ddb9a; background: rgba(125, 219, 154, 0.14); border: 1px solid rgba(125, 219, 154, 0.4); }
.cred-tier.tier-B { color: #8ed1ff; background: rgba(142, 209, 255, 0.14); border: 1px solid rgba(142, 209, 255, 0.4); }
.cred-tier.tier-C { color: #ffc16a; background: rgba(255, 193, 106, 0.14); border: 1px solid rgba(255, 193, 106, 0.4); }
.cred-tier.tier-D { color: var(--av-red); background: color-mix(in srgb, var(--av-red) 10%, transparent); border: 1px solid color-mix(in srgb, var(--av-red) 30%, var(--av-line)); }

.research-save-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--av-line-soft);
  background: var(--av-surface);
  border-radius: 10px;
}
.research-docs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-ink);
  align-items: center;
}

@media (max-width: 1100px) {
  .research-page, .research-page.with-sources { grid-template-columns: 240px 1fr; }
  .research-rail { display: none; }
}

/* Research source URL line */
.research-source-url {
  display: block;
  font-size: 10.5px;
  color: var(--av-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
  line-height: 1.3;
  font-family: "JetBrains Mono", monospace;
}

/* Research save modal */
.research-save-modal {
  max-width: 560px;
  width: 92vw;
  z-index: 27;
}
.save-preview {
  padding: 12px 14px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--av-text);
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.save-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: var(--av-text);
}
.save-option:hover {
  border-color: color-mix(in srgb, var(--av-red) 35%, var(--av-line));
}
.save-option input[type="checkbox"] {
  accent-color: var(--av-red);
  width: 14px;
  height: 14px;
}

/* Provider keys grid */
.provider-keys-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.provider-key-card {
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
@media (max-width: 1100px) {
  .provider-keys-grid { grid-template-columns: 1fr; }
}

/* Ensure portal-rendered modals sit above timesheet calendar blocks */
.modal-backdrop.modal-top {
  z-index: 1000;
}

/* --------------------------- Approved-leave blocks on Timesheet --------------------------- */
.cal-day.has-leave .cal-slots {
  position: relative;
}
.cal-leave-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 14px;
  gap: 8px;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 193, 106, 0.10) 0,
    rgba(255, 193, 106, 0.10) 8px,
    rgba(255, 193, 106, 0.04) 8px,
    rgba(255, 193, 106, 0.04) 16px
  );
  border: 1px solid rgba(255, 193, 106, 0.35);
  border-radius: 10px;
}
.cal-leave-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffc16a, #ff9c3a);
  border-radius: 10px 10px 0 0;
}
.cal-leave-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 193, 106, 0.18);
  border: 1px solid rgba(255, 193, 106, 0.5);
  border-radius: 999px;
  color: #ffc16a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.35);
}

.cal-month-cell.on-leave {
  background: rgba(255, 193, 106, 0.08);
  border-color: rgba(255, 193, 106, 0.35);
}
.cal-month-leave {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffc16a;
  margin-left: 4px;
}
.cal-month-leave-label {
  font-size: 9.5px;
  color: #ffc16a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

/* --------------------------- Security / Guardrail UI --------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
  font-family: "JetBrains Mono", monospace;
}
.status-pill.sev-low {
  color: #7ddb9a;
  background: rgba(125, 219, 154, 0.14);
  border-color: rgba(125, 219, 154, 0.4);
}
.status-pill.sev-medium {
  color: #8ed1ff;
  background: rgba(142, 209, 255, 0.14);
  border-color: rgba(142, 209, 255, 0.4);
}
.status-pill.sev-high {
  color: #ffc16a;
  background: rgba(255, 193, 106, 0.14);
  border-color: rgba(255, 193, 106, 0.4);
}
.status-pill.sev-critical {
  color: var(--av-red);
  background: color-mix(in srgb, var(--av-red) 14%, transparent);
  border-color: color-mix(in srgb, var(--av-red) 45%, transparent);
}
.status-pill.incident-status-open { color: #ffc16a; border-color: rgba(255, 193, 106, 0.4); background: rgba(255, 193, 106, 0.12); }
.status-pill.incident-status-investigating { color: #8ed1ff; border-color: rgba(142, 209, 255, 0.4); background: rgba(142, 209, 255, 0.12); }
.status-pill.incident-status-resolved { color: #7ddb9a; border-color: rgba(125, 219, 154, 0.4); background: rgba(125, 219, 154, 0.12); }
.status-pill.incident-status-false_positive { color: var(--av-text-dim); border-color: var(--av-line); background: var(--av-ink); }

.guardrail-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--av-red) 35%, var(--av-line));
  background: color-mix(in srgb, var(--av-red) 10%, var(--av-ink));
  margin-bottom: 14px;
  color: var(--av-text);
}
.guardrail-banner.sev-low {
  border-color: rgba(125, 219, 154, 0.4);
  background: rgba(125, 219, 154, 0.08);
}
.guardrail-banner.sev-medium {
  border-color: rgba(142, 209, 255, 0.4);
  background: rgba(142, 209, 255, 0.08);
}
.guardrail-banner.sev-high {
  border-color: rgba(255, 193, 106, 0.45);
  background: rgba(255, 193, 106, 0.10);
}
.guardrail-banner-title {
  font-weight: 700;
  font-size: 14px;
}
.guardrail-banner-sub {
  font-size: 12px;
  color: var(--av-text-dim);
  margin-top: 4px;
}

.guardrail-modal {
  z-index: 1000;
}

.guardrail-findings {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
  border-radius: 10px;
  max-height: 260px;
  overflow: auto;
}
.guardrail-finding-row {
  display: grid;
  grid-template-columns: 70px 50px 1fr 40px 140px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--av-line-soft);
}
.guardrail-finding-row:last-child { border-bottom: none; }
.guardrail-finding-row .cat {
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--av-text-dim);
}
.guardrail-finding-row .label { color: var(--av-text); }
.guardrail-finding-row .count { color: var(--av-text-dim); font-family: "JetBrains Mono", monospace; text-align: right; }
.guardrail-finding-row .snippet {
  color: var(--av-red);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.guardrail-pattern-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: var(--av-ink);
  border: 1px solid var(--av-line);
}

/* Compliance dashboard */
.compliance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.framework-card {
  display: flex;
  flex-direction: column;
}
.compliance-control-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-ink);
}
.evidence-input {
  width: 100%;
  margin-top: 6px;
  padding: 5px 8px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 6px;
  color: var(--av-text);
  font-size: 11.5px;
}
.status-select {
  padding: 5px 10px;
  background: var(--av-surface);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  color: var(--av-text);
  font-size: 11.5px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
}
.status-select.status-implemented { color: #7ddb9a; border-color: rgba(125, 219, 154, 0.4); background: rgba(125, 219, 154, 0.10); }
.status-select.status-partial { color: #ffc16a; border-color: rgba(255, 193, 106, 0.4); background: rgba(255, 193, 106, 0.10); }
.status-select.status-planned { color: var(--av-text-dim); }
.status-select.status-na { color: var(--av-text-dim); opacity: 0.6; }

.framework-row {
  padding: 10px 12px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-ink);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.framework-row:hover { border-color: color-mix(in srgb, var(--av-red) 30%, var(--av-line)); }

/* Incident register */
.incidents-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.incident-compact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.incident-compact-row:hover { border-color: color-mix(in srgb, var(--av-red) 40%, var(--av-line)); }

.incident-note {
  padding: 10px 12px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-ink);
}

.security-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--av-line);
  border-radius: 14px;
  background: var(--av-surface);
}
.security-summary.ok {
  border-color: rgba(35, 212, 139, 0.28);
}
.security-summary.warning {
  border-color: rgba(243, 177, 80, 0.32);
}
.security-summary.danger {
  border-color: rgba(255, 56, 63, 0.42);
}
.security-summary-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.security-summary-main h2 {
  margin: 6px 0 0;
  font-size: 20px;
}
.security-summary-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 11px;
  border: 1px solid var(--av-line);
  background: var(--av-ink);
  color: var(--av-text);
}
.security-summary.ok .security-summary-icon {
  color: #23d48b;
  border-color: rgba(35, 212, 139, 0.35);
}
.security-summary.warning .security-summary-icon {
  color: #f3b150;
  border-color: rgba(243, 177, 80, 0.4);
}
.security-summary.danger .security-summary-icon {
  color: var(--av-red);
  border-color: rgba(255, 56, 63, 0.45);
}
.security-summary-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 8px;
}
.security-summary-facts button {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-ink);
  text-align: left;
}
.security-summary-facts button:hover {
  border-color: rgba(255, 56, 63, 0.35);
}
.security-summary-facts span {
  display: block;
  color: var(--av-text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}
.security-summary-facts small {
  display: block;
  margin-top: 5px;
  color: var(--av-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .compliance-grid { grid-template-columns: 1fr; }
  .guardrail-finding-row {
    grid-template-columns: 60px 50px 1fr 40px;
  }
  .guardrail-finding-row .snippet { display: none; }
  .security-summary {
    grid-template-columns: 1fr;
  }
  .security-summary-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------- Business section --------------------------- */

.tabs.tabs-sub {
  margin-top: -4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--av-line-soft);
}
.tabs.tabs-sub .tab {
  font-size: 12px;
  padding: 8px 12px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 0;
}

.business-chart {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 18px 6px 6px;
  overflow-x: auto;
  min-height: 200px;
}

.business-bar-col {
  flex: 1 1 0;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.business-bar-value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.02em;
}

.business-bar-stack {
  position: relative;
  width: 28px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  border-radius: 4px;
  overflow: visible;
  background: var(--av-hover-tint);
}

.business-bar-seg {
  width: 100%;
  transition: height 0.4s ease;
}
.business-bar-seg.seg-billable { background: #23d48b; border-top-left-radius: 3px; border-top-right-radius: 3px; }
.business-bar-seg.seg-cnb { background: #7dd3fc; }
.business-bar-seg.seg-internal { background: #8b5cf6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; }

.business-bar-pct {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  color: #f59e0b;
  white-space: nowrap;
  pointer-events: none;
}

.business-bar-benchmark {
  position: absolute;
  left: -4px;
  right: -4px;
  height: 1px;
  border-top: 1px dashed rgba(245, 158, 11, 0.6);
  pointer-events: none;
}

.business-bar-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.05em;
}

.business-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.business-table th,
.business-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--av-line-soft);
  text-align: left;
}
.business-table th {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--av-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding-bottom: 10px;
}
.business-table tr:hover td {
  background: var(--av-hover-tint);
}
.business-table a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--av-line);
}
.business-table a:hover {
  border-bottom-color: var(--av-red);
}
@media (max-width: 760px) {
  .projects-list-wrap,
  .business-table-wrap {
    border-radius: 12px;
  }
  .business-table {
    min-width: 720px;
  }
  .projects-list-wrap {
    background: transparent;
    border: 0;
  }
  .projects-list-wrap .projects-list-table,
  .projects-list-wrap .projects-list-table thead,
  .projects-list-wrap .projects-list-table tbody,
  .projects-list-wrap .projects-list-table tr,
  .projects-list-wrap .projects-list-table td {
    display: block;
  }
  .projects-list-wrap .projects-list-table thead {
    display: none;
  }
  .projects-list-wrap .projects-list-row {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--av-line);
    border-radius: 12px;
    background: var(--av-ink);
  }
  .projects-list-wrap .projects-list-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--av-line-soft);
  }
  .projects-list-wrap .projects-list-table td:last-child {
    border-bottom: 0;
  }
  .projects-list-wrap .projects-list-table td::before {
    flex-shrink: 0;
    color: var(--av-muted);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .projects-list-wrap .projects-list-table td:nth-child(1)::before { content: "Project"; }
  .projects-list-wrap .projects-list-table td:nth-child(2)::before { content: "Client"; }
  .projects-list-wrap .projects-list-table td:nth-child(3)::before { content: "Status"; }
  .projects-list-wrap .projects-list-table td:nth-child(4)::before { content: "Owner"; }
  .projects-list-wrap .projects-list-table td:nth-child(5)::before { content: "Progress"; }
  .projects-list-wrap .projects-list-table td:nth-child(6)::before { content: "Deadline"; }
  .incident-table,
  .incident-table thead,
  .incident-table tbody,
  .incident-table tr,
  .incident-table td {
    display: block;
  }
  .incident-table thead {
    display: none;
  }
  .incident-table .projects-list-row {
    margin: 10px;
    padding: 10px 12px;
    border: 1px solid var(--av-line);
    border-radius: 12px;
    background: var(--av-ink);
  }
  .incident-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--av-line-soft);
  }
  .incident-table td:last-child {
    border-bottom: 0;
  }
  .incident-table td::before {
    flex-shrink: 0;
    color: var(--av-muted);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .incident-table td:nth-child(1)::before { content: "Code"; }
  .incident-table td:nth-child(2)::before { content: "Severity"; }
  .incident-table td:nth-child(3)::before { content: "Type"; }
  .incident-table td:nth-child(4)::before { content: "Title"; }
  .incident-table td:nth-child(5)::before { content: "Source"; }
  .incident-table td:nth-child(6)::before { content: "Actor"; }
  .incident-table td:nth-child(7)::before { content: "Status"; }
  .incident-table td:nth-child(8)::before { content: "Time"; }
}

/* --------------------------- Creative Studio --------------------------- */

.creative-studio {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.cs-rail {
  border: 1px solid var(--av-line);
  border-radius: 12px;
  background: var(--av-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cs-rail-head {
  padding: 10px;
  border-bottom: 1px solid var(--av-line-soft);
}
.cs-rail-head input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--av-line);
  background: transparent;
  color: var(--av-text);
  font-size: 13px;
}

.cs-rail-list {
  overflow-y: auto;
  padding: 6px;
  flex: 1;
}

.cs-rail-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.cs-rail-item:hover {
  background: var(--av-hover-tint);
}
.cs-rail-item.active {
  background: var(--av-red-soft);
  border-color: rgba(255, 56, 63, 0.28);
}

.cs-rail-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--av-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-rail-item-meta {
  margin-top: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--av-muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

.cs-dot-live {
  color: #23d48b;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.cs-main {
  border: 1px solid var(--av-line);
  border-radius: 12px;
  background: var(--av-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.cs-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--av-muted);
  padding: 40px;
}

.cs-session {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.cs-session-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--av-line-soft);
}
.cs-title {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  flex: 1;
  padding: 4px 0;
}
.cs-title:focus {
  outline: none;
}

.cs-toolbar {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--av-line-soft);
}
.cs-tool {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--av-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.cs-tool:hover { color: var(--av-text); }
.cs-tool.active {
  background: var(--av-red-soft);
  color: var(--av-red);
  border-color: rgba(255, 56, 63, 0.35);
}

.cs-jobs {
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--av-line-soft);
  position: relative;
}
.cs-job-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--av-surface-3);
  border: 1px solid var(--av-line);
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  font-size: 11px;
}
.cs-job-chip button {
  background: transparent;
  border: none;
  color: var(--av-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
}
.cs-job-chip button:hover { color: #ff6b71; }

.cs-job-add {
  background: transparent;
  border: 1px dashed var(--av-line);
  color: var(--av-muted);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cs-job-add:hover { color: var(--av-text); border-color: rgba(255, 56, 63, 0.35); }

.cs-job-pop {
  position: absolute;
  top: 100%;
  left: 16px;
  z-index: 30;
  background: var(--av-code-bg);
  border: 1px solid var(--av-line);
  border-radius: 10px;
  width: 280px;
  max-height: 280px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.cs-job-pop input {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--av-line);
  background: transparent;
  color: var(--av-text);
  margin-bottom: 6px;
}
.cs-job-pop-list { overflow-y: auto; flex: 1; }
.cs-job-row {
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.cs-job-row:hover { background: var(--av-hover-tint); }
.cs-job-row.on { background: var(--av-red-soft); color: var(--av-red); }

.cs-history {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 16px;
  min-height: 0;
}

.cs-empty-history {
  margin: auto;
  text-align: center;
  color: var(--av-muted);
  padding: 40px;
}

.cs-pending {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--av-red-soft);
  border: 1px solid rgba(255, 56, 63, 0.25);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-gen-card {
  border: 1px solid var(--av-line);
  border-radius: 10px;
  padding: 12px;
  background: var(--av-surface);
}
.cs-gen-head { margin-bottom: 10px; }
.cs-gen-prompt {
  font-size: 13px;
  color: var(--av-text);
  line-height: 1.4;
}
.cs-gen-meta { margin-top: 4px; }
.cs-gen-loading,
.cs-gen-failed {
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
}
.cs-gen-loading {
  background: var(--av-hover-tint);
  color: var(--av-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-gen-failed {
  background: rgba(255, 107, 113, 0.12);
  color: #ff6b71;
}
.cs-gen-outputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.cs-gen-output {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.cs-gen-output img,
.cs-gen-output video {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: zoom-in;
}
.cs-gen-actions {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.cs-gen-output:hover .cs-gen-actions { opacity: 1; }
.cs-gen-actions button,
.cs-gen-actions a {
  background: rgba(0, 0, 0, 0.72);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.cs-gen-actions button:hover,
.cs-gen-actions a:hover {
  background: var(--av-red);
}

.cs-save-menu {
  position: absolute;
  bottom: 28px;
  right: 0;
  background: var(--av-code-bg);
  border: 1px solid var(--av-line);
  border-radius: 8px;
  padding: 4px;
  min-width: 160px;
  z-index: 20;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.cs-save-row {
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--av-text);
}
.cs-save-row:hover { background: var(--av-red-soft); }

.cs-composer {
  border-top: 1px solid var(--av-line-soft);
  padding: 14px 16px 12px;
  background: var(--av-ink);
}
.cs-composer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.cs-model-btn,
.cs-ctx-btn,
.cs-advanced-btn,
.cs-budget-chip,
.cs-inline-setting {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 8px;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  color: var(--av-text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cs-model-btn {
  font-weight: 600;
  color: var(--av-text);
}
.cs-model-btn:hover,
.cs-ctx-btn:hover,
.cs-advanced-btn:hover {
  border-color: rgba(255, 56, 63, 0.35);
  color: var(--av-text);
}
.cs-ctx-btn.on,
.cs-advanced-btn.on {
  background: var(--av-red-soft);
  border-color: rgba(255, 56, 63, 0.35);
  color: var(--av-red);
}
.cs-inline-setting {
  cursor: default;
}
.cs-inline-setting span,
.cs-setting-field span {
  color: var(--av-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cs-inline-setting select,
.cs-setting-field select {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--av-text);
  font-size: 12px;
  cursor: pointer;
}
.cs-budget-chip {
  cursor: default;
  color: var(--av-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.cs-composer-spacer {
  flex: 1;
}

.cs-composer-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.cs-composer-row textarea {
  flex: 1;
  resize: none;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  color: var(--av-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  min-height: 52px;
  max-height: 200px;
}
.cs-composer-row textarea:focus {
  outline: none;
  border-color: rgba(255, 56, 63, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 56, 63, 0.08);
}
.cs-advanced-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 160px)) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--av-line-soft);
  border-radius: 10px;
  background: var(--av-surface);
}
.cs-setting-field {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--av-line-soft);
  border-radius: 8px;
  background: var(--av-ink);
}
.cs-tool-hint {
  line-height: 1.45;
}
.cs-composer-foot { margin-top: 6px; }

@media (max-width: 900px) {
  .cs-layout {
    grid-template-columns: 1fr;
  }
  .cs-rail {
    min-height: 160px;
    max-height: 220px;
  }
  .cs-advanced-panel {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .cs-composer-row {
    flex-direction: column;
    align-items: stretch;
  }
  .cs-composer-controls > *,
  .cs-inline-setting,
  .cs-budget-chip {
    width: 100%;
    justify-content: space-between;
  }
  .cs-composer-spacer {
    display: none;
  }
}

.cs-error {
  padding: 8px 12px;
  background: rgba(255, 107, 113, 0.12);
  color: #ff6b71;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 8px;
}

.cs-model-picker {
  position: fixed;
  bottom: 92px;
  left: 300px;
  z-index: 80;
  width: 420px;
  max-height: 60vh;
  background: var(--av-code-bg);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cs-model-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--av-line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cs-model-head button {
  background: transparent;
  border: none;
  color: var(--av-muted);
  cursor: pointer;
}
.cs-model-list { overflow-y: auto; padding: 6px; }
.cs-model-row {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
  margin-bottom: 4px;
}
.cs-model-row:hover { background: var(--av-hover-tint); }
.cs-model-row.active {
  background: var(--av-red-soft);
  border-color: rgba(255, 56, 63, 0.35);
}
.cs-model-row.off,
.cs-model-row.no-key {
  opacity: 0.5;
  cursor: not-allowed;
}
.cs-model-row-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.cs-model-row-sub {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.cs-model-row-sub .pill {
  font-size: 10px;
  padding: 1px 6px;
}
.cs-model-row-sub .pill-off {
  background: rgba(255, 107, 113, 0.14);
  color: #ff6b71;
}
.cs-model-row-sub .pill-warn {
  background: rgba(255, 181, 71, 0.14);
  color: #ffb547;
}
.cs-model-row-hint {
  font-size: 11px;
  color: var(--av-muted);
  margin-top: 6px;
  line-height: 1.3;
}

.cs-ctx-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  display: flex;
  justify-content: flex-end;
}
.cs-ctx-panel {
  width: 420px;
  max-width: 90vw;
  background: var(--av-ink);
  border-left: 1px solid var(--av-line);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.cs-ctx-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.cs-ctx-head button {
  background: transparent;
  border: none;
  color: var(--av-muted);
  cursor: pointer;
}
.cs-ctx-notes {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--av-line);
  background: var(--av-surface);
  color: var(--av-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
  margin-top: 6px;
}

.cs-ref-add {
  background: transparent;
  border: 1px solid var(--av-line);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  color: var(--av-text-dim);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cs-ref-add:hover { border-color: rgba(255, 56, 63, 0.35); color: var(--av-red); }

.cs-ref-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.cs-ref-lib { opacity: 0.85; }
.cs-ref-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--av-surface);
  cursor: pointer;
}
.cs-ref-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cs-ref-cell button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cs-ref-add-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--av-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.cs-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.cs-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin { animation: cs-spin 1s linear infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }

/* --------------------------- Sidebar · scroll + collapse --------------------------- */

/* Restructure the sidebar so nav scrolls and the timer card stays pinned.
   This fixes the bug where the Settings submenu pushes the timer card
   out of view when the user is an Admin and every nav item is visible. */
.sidebar {
  min-height: 0;        /* allow inner overflow within grid row */
  overflow: hidden;     /* internal scroll handled by .sidebar-nav-wrap */
  transition: width 200ms ease;
}

.sidebar-top {
  flex: none;
}

.sidebar-nav-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 -14px;      /* extend scroll area edge-to-edge under sidebar padding */
  padding: 0 14px;
}

.sidebar-bottom {
  flex: none;
  padding-top: 12px;
  border-top: 1px solid var(--av-line-soft);
  margin: 12px -14px 0;
  padding: 12px 14px 0;
}

/* Brand row gets the collapse toggle */
.sidebar .brand {
  position: relative;
}
.sidebar-collapse-btn {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--av-line-soft);
  background: transparent;
  color: var(--av-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.sidebar-collapse-btn:hover {
  color: var(--av-text);
  border-color: var(--av-line);
  background: var(--av-hover-tint);
}

/* Collapsed state: narrow rail, icons only */
.app[data-sidebar-collapsed="true"] {
  grid-template-columns: 64px 1fr;
}
html[data-sidebar-collapsed="true"] .app {
  grid-template-columns: 64px 1fr;
}

.sidebar.collapsed {
  padding-left: 8px;
  padding-right: 8px;
}
.sidebar.collapsed .sidebar-nav-wrap,
.sidebar.collapsed .sidebar-bottom {
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.sidebar.collapsed .brand {
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 14px;
  align-items: center;
}
.sidebar.collapsed .brand-meta {
  display: none;
}
.sidebar.collapsed .sidebar-collapse-btn {
  margin-left: 0;
}

.sidebar.collapsed .nav-section {
  display: none;
}
.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-sub-item {
  justify-content: center;
  padding: 9px 6px;
  gap: 0;
}
.sidebar.collapsed .nav-item > span,
.sidebar.collapsed .nav-sub-item > span,
.sidebar.collapsed .nav-item-with-toggle .nav-toggle,
.sidebar.collapsed .nav-item .lock-ico {
  display: none;
}
.sidebar.collapsed .nav-item .count,
.sidebar.collapsed .nav-sub-item .count {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 9px;
  padding: 0 4px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
}
.sidebar.collapsed .nav-item.active::before {
  left: -8px;
}
.sidebar.collapsed .nav-item-with-toggle .nav-item-main {
  flex: 1;
  justify-content: center;
}

/* Compact timer button shown when sidebar is collapsed */
.timer-card-compact {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--av-line-soft);
  background: transparent;
  color: var(--av-muted);
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.timer-card-compact:hover {
  color: var(--av-text);
  border-color: var(--av-line);
  background: var(--av-hover-tint);
}
.timer-card-compact.active {
  color: #ff383f;
  border-color: rgba(255, 56, 63, 0.45);
  background: rgba(255, 56, 63, 0.08);
}
.timer-card-compact.active::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff383f;
  margin: -22px 0 0 22px;
  box-shadow: 0 0 8px rgba(255, 56, 63, 0.7);
  animation: timer-pulse 1.4s ease-in-out infinite;
}
.timer-card-compact.ready {
  color: #ff383f;
  border-color: rgba(255, 56, 63, 0.3);
}
@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

[data-theme="light"] .sidebar-collapse-btn {
  border-color: rgba(0, 0, 0, 0.08);
}

/* --------------------------- AI agent assignment --------------------------- */

.agent-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 56, 63, 0.18), rgba(0, 0, 0, 0.4));
  border: 1px solid rgba(255, 56, 63, 0.35);
  color: #ff8a8f;
  flex-shrink: 0;
}
.agent-avatar.agent-avatar-sm {
  width: 24px;
  height: 24px;
}
.comment-agent-avatar {
  margin-right: 0;
}

.assignee-popover .picker-head {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--av-muted);
  padding: 8px 10px 4px;
}
.assignee-popover .agent-opt {
  border-radius: 8px;
}
.assignee-popover .agent-opt:hover {
  background: rgba(255, 56, 63, 0.07);
}

.bubble.bubble-agent {
  border-color: rgba(255, 56, 63, 0.25);
  background: linear-gradient(180deg, rgba(255, 56, 63, 0.04), rgba(255, 56, 63, 0));
}
.agent-tag {
  display: inline-block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 56, 63, 0.15);
  color: #ff8a8f;
  margin-left: 6px;
  vertical-align: 1px;
}

.agent-run-modal {
  max-width: 600px;
}
.agent-context {
  background: var(--av-ink);
  border: 1px solid var(--av-line-soft);
  border-radius: 10px;
  padding: 12px 14px;
}
.agent-context-pre {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--av-text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

[data-theme="light"] .agent-avatar {
  background: linear-gradient(135deg, rgba(255, 56, 63, 0.12), rgba(0, 0, 0, 0.05));
  color: #c52026;
}
