:root {
  color-scheme: dark;
  --app: #181918;
  --rail: #151615;
  --nav: #1d1f1e;
  --nav-soft: #282b29;
  --panel: #1f2120;
  --card: #262827;
  --card-hover: #2c2f2d;
  --text: #f0f2ef;
  --muted: #9ca39e;
  --quiet: #6f7771;
  --line: #333735;
  --line-soft: #2b2f2c;
  --accent: #5f8dff;
  --green: #6fbf7b;
  --yellow: #d8b85c;
  --red: #e46b61;
  --tag-red: rgba(228, 107, 97, .18);
  --tag-yellow: rgba(216, 184, 92, .17);
  --tag-green: rgba(111, 191, 123, .15);
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  background: var(--app);
  color: var(--text);
}

h1, h2, h3, p { margin: 0; }

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 44px 176px minmax(0, 1fr);
  background: var(--app);
}

body.sidebar-hidden .app-shell {
  grid-template-columns: 44px 0 minmax(0, 1fr);
}

body.sidebar-hidden .sidebar {
  min-width: 0;
  width: 0;
  padding: 0;
  border-right: 0;
  overflow: hidden;
}

.icon-rail {
  min-height: 0;
  padding: 8px 6px;
  border-right: 1px solid #222422;
  background: var(--rail);
  display: grid;
  grid-template-rows: repeat(8, auto) minmax(0, 1fr) auto auto;
  gap: 10px;
  justify-items: center;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: transparent;
  overflow: hidden;
}

.avatar img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.icon-rail button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  color: var(--quiet);
  background: transparent;
  font-size: 16px;
}

.icon-rail button svg {
  width: 17px;
  height: 17px;
  display: block;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-rail button:hover,
.icon-rail .rail-active {
  color: #fff;
  background: #2a2d2b;
}

.rail-spacer { min-height: 0; }

.sidebar {
  min-width: 0;
  padding: 8px 5px;
  border-right: 1px solid #262927;
  background: var(--nav);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.sidebar-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.brand {
  padding: 3px 5px 7px;
  display: grid;
  gap: 3px;
}

.brand span {
  color: var(--quiet);
  font-size: 11px;
}

.brand strong {
  font-size: 15px;
  line-height: 1.15;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 2px;
}

.side-nav button {
  width: 100%;
  min-height: 31px;
  border: 0;
  border-radius: var(--radius);
  padding: 7px 8px;
  text-align: left;
  color: #d6dad7;
  background: transparent;
  font-size: 13px;
}

.side-nav button.active,
.side-nav button:hover {
  background: var(--nav-soft);
  color: #fff;
}

.nav-section {
  display: grid;
  gap: 2px;
}

.nav-section.collapsed .list-nav,
.nav-section.collapsed .filter-hint,
.nav-section.collapsed .tag-nav,
.nav-section.collapsed .tag-form {
  display: none;
}

.nav-section-head {
  min-height: 22px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.nav-section-head h2 {
  flex: 1;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-section-head button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  color: var(--quiet);
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.section-toggle {
  width: 18px !important;
  height: 18px !important;
  font-size: 13px !important;
}

.nav-section-head button:hover {
  color: var(--text);
  background: var(--nav-soft);
}

.list-nav,
.tag-nav {
  display: grid;
  gap: 1px;
}

.list-row,
.tag-row,
.filter-hint {
  width: 100%;
  min-height: 29px;
  border: 0;
  border-radius: var(--radius);
  padding: 5px 6px;
  color: #d5d9d6;
  background: transparent;
  display: grid;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.list-row {
  grid-template-columns: 15px minmax(0, 1fr) auto;
}

.tag-row {
  grid-template-columns: 15px 18px minmax(0, 1fr);
  font-size: 11px;
}

.filter-hint {
  min-height: 52px;
  padding: 7px 6px;
  color: var(--quiet);
  background: rgba(255,255,255,.035);
  text-align: left;
  font-size: 11px;
  line-height: 1.22;
}

.list-row:hover,
.tag-row:hover,
.filter-hint:hover,
.list-row.dragging,
.tag-row.dragging,
.list-row.active {
  background: var(--nav-soft);
}

.list-row.active {
  color: #fff;
}

.drag-handle {
  color: #697069;
  font-size: 13px;
  cursor: grab;
}

.list-name,
.tag-row span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-count {
  color: var(--quiet);
  font-size: 11px;
}

.tag-icon {
  width: 12px;
  height: 12px;
  display: inline-grid;
  place-items: center;
  color: var(--tag-color, #858b86);
  opacity: .9;
}

.tag-icon svg,
.tag-dot svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.tag-icon path,
.tag-dot path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.tag-icon circle,
.tag-dot circle {
  fill: currentColor;
  stroke: none;
}

.tag-form {
  padding: 4px 6px;
}

.tag-form input {
  width: 100%;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 7px;
  color: var(--text);
  background: #191b1a;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.tag-form input:focus {
  border-color: #4b6f61;
}

.side-status {
  min-height: 30px;
  padding: 7px 8px;
  border-radius: var(--radius);
  color: var(--quiet);
  background: rgba(255,255,255,.04);
  font-size: 11px;
}

.workspace {
  min-width: 0;
  height: 100vh;
  padding: 8px 10px 10px;
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
  gap: 8px;
  background: var(--app);
}

.workspace-head {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.workspace-title {
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.workspace-title:hover .toggle-mark {
  color: var(--text);
  background: var(--nav-soft);
}

.toggle-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-actions button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--panel);
  font-size: 17px;
  line-height: 1;
}

.board-actions button:hover {
  color: var(--text);
  background: var(--card-hover);
}

h1 {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#openSettings {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: #d8ddda;
  background: var(--panel);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#openSettings .settings-gear {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#openSettings:hover {
  border-color: #46504a;
  background: #252927;
}

#pollEmail {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: #d8ddda;
  background: var(--panel);
  font-size: 12px;
}

#pollEmail:hover {
  border-color: #46504a;
  background: #252927;
}

#pollEmail:disabled { opacity: .6; }

.view {
  min-height: 0;
  display: none;
}

.view.active {
  display: grid;
}

#todayView {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.today-summary {
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.today-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px 9px;
  background: var(--panel);
  display: grid;
  gap: 3px;
}

.today-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--quiet);
  font-size: 11px;
}

.today-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 16px;
  line-height: 1.1;
}

.today-card.critical {
  border-color: rgba(228, 107, 97, .42);
  background: rgba(228, 107, 97, .08);
}

.today-card.watch {
  border-color: rgba(216, 184, 92, .35);
  background: rgba(216, 184, 92, .07);
}

.today-card.ok {
  background: rgba(111, 191, 123, .045);
}

#casesView,
.cases-focus {
  min-height: 0;
}

.cases-focus,
.company-map {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.section-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-head h2 {
  font-size: 13px;
  line-height: 1.1;
  font-weight: 700;
}

.section-head p {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
}

.section-head strong {
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #222522;
  font-size: 11px;
}

.section-head.compact {
  min-height: 28px;
  gap: 8px;
}

.now-panel {
  min-height: 150px;
  max-height: 180px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.now-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  overflow: auto;
}

.now-item {
  min-width: 0;
  min-height: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
}

.now-open,
.pipeline-open,
.inbox-row {
  min-width: 0;
  border: 0;
  padding: 0;
  text-align: left;
  color: inherit;
  background: transparent;
}

.now-open {
  display: grid;
  gap: 3px;
}

.now-open strong,
.pipeline-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 650;
}

.now-client,
.now-reason,
.client,
.meta,
.timeline-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.now-reason { color: var(--yellow); }

.now-action {
  min-height: 28px;
  border: 1px solid #3f554a;
  border-radius: var(--radius);
  padding: 5px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e7f0eb;
  background: #244036;
  font-size: 12px;
}

.today-sections {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.today-section {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--panel);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
}

.today-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  overflow: auto;
}

.today-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 7px;
  color: inherit;
  background: var(--card);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  text-align: left;
}

.today-row:hover {
  border-color: #4c514b;
  background: #242722;
}

.today-row-main,
.today-row-side {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.today-row-main strong,
.today-row-main span,
.today-row-side span,
.today-row-side em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-row-main strong {
  font-size: 12px;
  line-height: 1.25;
  font-weight: 650;
}

.today-row-main span,
.today-row-side span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.today-row-side {
  justify-items: end;
  max-width: 82px;
}

.today-row-side em {
  max-width: 82px;
  color: var(--quiet);
  font-size: 10px;
  line-height: 1.2;
  font-style: normal;
}

.empty.compact {
  padding: 8px 6px;
  font-size: 11px;
}

.pipeline-board {
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  gap: 7px;
  overflow-x: auto;
}

.pipeline-board.standalone {
  height: 100%;
}

.pipeline-col {
  position: relative;
  min-width: 198px;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
}

.pipeline-col.collapsed {
  position: relative;
  z-index: 4;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  background: var(--app);
}

.pipeline-col.drag-over .pipeline-items {
  outline: 1px solid #4b6f61;
  background: #202722;
}

.pipeline-col header {
  min-height: 25px;
  padding: 0 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.pipeline-col.collapsed header {
  height: 100%;
  min-height: 260px;
  padding: 2px 0 8px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  gap: 8px;
}

.pipeline-col h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  cursor: text;
}

.pipeline-col.collapsed h3 {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 520px;
  text-align: left;
  color: #d6dad7;
}

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

.pipeline-col.collapsed .column-actions {
  grid-row: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.pipeline-col.collapsed h3 {
  grid-row: 2;
}

.column-count {
  min-width: 22px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--quiet);
  background: #222522;
  font-size: 11px;
}

.column-automation,
.column-add,
.column-collapse {
  width: 20px;
  height: 22px;
  border: 0;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #a8afa9;
  background: #232624;
  box-shadow: none;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.column-automation {
  font-size: 12px;
}

.column-automation:hover,
.column-add:hover,
.column-collapse:hover {
  color: var(--text);
  background: #2f3431;
  border-color: #454b47;
}

.pipeline-col.collapsed .column-add {
  display: none;
}

.pipeline-col.collapsed .column-automation {
  display: none;
}

.pipeline-col.collapsed .column-collapse {
  transform: none;
  width: 20px;
  height: 22px;
  border-radius: 999px;
}

.pipeline-items {
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  padding-right: 2px;
  display: grid;
  align-content: start;
  gap: 5px;
  overflow: auto;
}

.pipeline-col.collapsed .pipeline-items {
  display: none;
}

.pipeline-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 16px 6px 7px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(255,255,255,.02);
  display: block;
}

.pipeline-card:hover {
  background: var(--card-hover);
  border-color: #444946;
}

.pipeline-card.selected {
  border-color: #5d6b64;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.pipeline-card.dragging {
  opacity: .52;
  transform: scale(.985);
}

.pipeline-card[data-flag="red"]::after,
.pipeline-card[data-flag="yellow"]::after,
.pipeline-card[data-flag="blue"]::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 10px;
}

.pipeline-card[data-flag="red"] {
  border-color: rgba(228, 107, 97, .55);
  background: rgba(228, 107, 97, .10);
}

.pipeline-card[data-flag="red"]::after {
  background: #ef3e38;
}

.pipeline-card[data-flag="yellow"] {
  border-color: rgba(216, 184, 92, .52);
  background: rgba(216, 184, 92, .10);
}

.pipeline-card[data-flag="yellow"]::after {
  background: #f4a62a;
}

.pipeline-card[data-flag="blue"] {
  border-color: rgba(95, 141, 255, .50);
  background: rgba(95, 141, 255, .10);
}

.pipeline-card[data-flag="blue"]::after {
  background: #4878ff;
}

.pipeline-open {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  display: grid;
  gap: 4px;
}

.card-title-row {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: baseline;
  gap: 5px;
}

.pipeline-open .meta {
  display: grid;
  gap: 3px;
  white-space: normal;
}

.pipeline-open .meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tags {
  min-height: 14px;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}

.card-alerts {
  max-width: 42px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--quiet);
  background: transparent;
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
  text-align: right;
}

.card-alerts span {
  color: #7c837e;
  font-size: 9px;
  line-height: 1;
}

.card-alerts em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.card-alerts[hidden] {
  display: none;
}

.tag-chip {
  max-width: 100%;
  border-radius: 5px;
  padding: 1px 5px 1px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cfd5d1;
  background: #373b38;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.25;
}

.tag-chip .tag-dot {
  width: 10px;
  height: 10px;
  opacity: .95;
}

.tag-chip[data-color="mint"] { color: #bddbd5; background: rgba(154, 199, 188, .13); }
.tag-chip[data-color="green"] { color: #c2e8cc; background: rgba(68, 208, 123, .11); }
.tag-chip[data-color="yellow"] { color: #e2cf8d; background: rgba(216, 184, 92, .13); }
.tag-chip[data-color="red"] { color: #efc2bd; background: rgba(228, 107, 97, .13); }
.tag-chip[data-color="blue"] { color: #c8d4ff; background: rgba(101, 134, 255, .14); }
.tag-chip[data-color="gray"] { color: #c3c9c5; background: rgba(140, 147, 142, .12); }

.placeholder,
.timeline-list,
.work-list {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  background: var(--panel);
  overflow: auto;
}

.work-view {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

#clientsView .work-view {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.work-list {
  padding: 6px;
  display: grid;
  align-content: start;
  gap: 1px;
}

.inbox-queue {
  margin-bottom: 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px 9px;
  background: #232624;
  display: grid;
  gap: 4px;
}

.inbox-queue div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.inbox-queue strong {
  color: var(--text);
  font-size: 12px;
}

.inbox-queue span,
.inbox-queue p {
  color: var(--quiet);
  font-size: 11px;
}

.queue-stats {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px !important;
}

.queue-stats span {
  min-width: 0;
  border-radius: var(--radius);
  padding: 5px 6px;
  background: rgba(255,255,255,.045);
  display: grid;
  gap: 1px;
}

.queue-stats b {
  color: var(--text);
  font-size: 13px;
}

.queue-items {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px !important;
}

.queue-items em {
  min-width: 0;
  border-radius: var(--radius);
  padding: 5px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd6d0;
  background: rgba(255,255,255,.035);
  font-size: 11px;
  font-style: normal;
}

.work-row {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 7px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: inherit;
  background: transparent;
}

.work-row:hover {
  background: var(--card-hover);
}

.client-list {
  display: block;
  overflow: auto;
  position: relative;
}

.client-filterbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.client-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.client-toolbar input {
  width: 100%;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  font-size: 11px;
  outline: none;
}

.client-toolbar input:focus {
  border-color: rgba(154,199,188,.45);
  background: rgba(255,255,255,.025);
}

.client-segments {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 2px 4px;
  margin: 0;
}

.client-segment-card {
  position: relative;
  flex: 0 0 auto;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  padding: 2px 0 5px;
  background: transparent;
  color: var(--quiet);
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.client-segment-card strong,
.client-segment-card span {
  display: inline;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-segment-card strong {
  color: inherit;
  font-size: 12px;
  font-weight: 500;
}

.client-segment-card span {
  margin-top: 0;
  color: #7e8781;
  font-size: 10px;
}

.client-segment-card:hover,
.client-segment-card.active {
  color: var(--text);
  background: transparent;
}

.client-segment-card.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: #9ac7bc;
}

.client-table {
  min-width: 1160px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,.014);
}

.client-table-head,
.client-table-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(210px, 1fr) 72px 116px 132px 120px minmax(280px, 1.6fr);
  align-items: center;
  gap: 0;
}

.client-table-head {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 32px;
  color: var(--quiet);
  background: #181b19;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.client-sort {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.client-sort span {
  color: var(--text);
  font-size: 10px;
}

.client-sort:hover,
.client-sort.active {
  color: var(--text);
}

.client-table-head span,
.client-table-row > span {
  min-width: 0;
  padding: 7px 9px;
  border-right: 1px solid var(--line-soft);
}

.client-table-head span:last-child,
.client-table-row > span:last-child {
  border-right: 0;
}

.client-table-row {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}

.client-table-row:last-child {
  border-bottom: 0;
}

.client-table-row:hover {
  background: var(--card-hover);
}

.client-name-cell,
.client-context {
  display: grid;
  gap: 2px;
}

.client-name-cell strong,
.client-name-cell small,
.client-context em,
.client-context small,
.client-muted {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-name-cell strong {
  color: var(--text);
  font-size: 12px;
}

.client-name-cell small,
.client-muted,
.client-context small {
  color: var(--quiet);
  font-size: 11px;
}

.client-context em {
  color: #d8c986;
  font-style: normal;
  font-size: 12px;
}

.client-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #aeb6b1;
  background: rgba(255,255,255,.055);
  font-size: 11px;
}

.client-nowrap {
  white-space: nowrap;
}

.client-inline-input,
.client-inline-select {
  width: 100%;
  min-width: 0;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.client-inline-input.tags {
  height: 22px;
  padding: 1px 0;
  color: var(--quiet);
  font-size: 11px;
}

.client-inline-input.context {
  height: 20px;
  padding: 0;
  color: #d8c986;
  font-size: 12px;
}

.client-inline-input:hover,
.client-inline-input:focus,
.client-inline-select:hover,
.client-inline-select:focus {
  border-color: var(--line);
  background: rgba(255,255,255,.035);
}

.client-delete {
  justify-self: start;
  width: auto;
  min-height: 18px;
  border: 0;
  padding: 0;
  color: #a98f8b;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.client-delete:hover {
  color: #e46b61;
}

.client-status.active {
  color: #b9d7cc;
  background: rgba(154, 199, 188, .11);
}

.client-status.important {
  color: #f0d78c;
  background: rgba(216, 184, 92, .12);
}

.settings-view {
  height: 100%;
  overflow: auto;
  display: block;
}

.settings-tabs {
  min-height: 34px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line-soft);
}

.settings-tabs button {
  min-height: 31px;
  border: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
}

.settings-tabs button:hover,
.settings-tabs button.active {
  color: var(--text);
  background: var(--panel);
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

.segmented button {
  min-height: 26px;
  border: 0;
  border-radius: 5px;
  padding: 4px 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.segmented button svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.segmented button:hover,
.segmented button.active {
  color: var(--text);
  background: var(--card-hover);
}

.settings-grid {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-bottom: 16px;
}

.settings-panel[hidden] {
  display: none;
}

.settings-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.settings-card {
  padding: 10px 12px;
  display: grid;
  gap: 9px;
}

.settings-toggle {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 12px;
}

.settings-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.settings-toggle span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.settings-toggle strong {
  font-size: 12px;
}

.settings-toggle em,
.settings-note {
  color: var(--quiet);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.settings-field {
  display: grid;
  gap: 5px;
}

.settings-field span {
  color: var(--muted);
  font-size: 11px;
}

.settings-field input {
  width: 100%;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--text);
  background: #191b1a;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.settings-status-row {
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.settings-status-row strong {
  color: var(--text);
  font-size: 12px;
}

.settings-status-row strong.ok {
  color: #bfe8c6;
}

.settings-status-row strong.watch {
  color: #ead58c;
}

.settings-status-row strong.critical {
  color: #ffbbb5;
}

.team-settings {
  gap: 12px;
}

.team-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.team-overview article {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px 9px;
  background: #242725;
  display: grid;
  gap: 3px;
}

.team-overview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--quiet);
  font-size: 11px;
}

.team-overview strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.1;
}

.org-tree {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px;
  background: #222523;
  display: grid;
  gap: 6px;
}

.org-tree h4 {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
}

.org-children {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 5px;
}

.org-line {
  min-height: 26px;
  border-radius: var(--radius);
  padding: 5px 7px;
  background: rgba(255,255,255,.035);
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.org-line strong {
  color: var(--text);
  font-size: 12px;
}

.org-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.org-line.muted {
  background: transparent;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.team-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--card);
  display: grid;
  gap: 8px;
}

.team-card.active {
  border-color: rgba(111, 191, 123, .34);
  background: rgba(111, 191, 123, .055);
}

.team-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.team-card-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.team-card-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
}

.team-card-head span,
.team-card small {
  color: var(--muted);
  font-size: 11px;
}

.team-card-head em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  color: #cbd6d0;
  background: rgba(255,255,255,.07);
  font-size: 10px;
  font-style: normal;
}

.team-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.team-metrics span,
.team-impact span {
  border-radius: var(--radius);
  padding: 5px 6px;
  color: var(--quiet);
  background: rgba(255,255,255,.04);
  display: grid;
  gap: 1px;
  font-size: 10px;
}

.team-metrics b,
.team-impact b {
  color: var(--text);
  font-size: 13px;
}

.team-impact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.team-impact span {
  background: rgba(95, 141, 255, .055);
}

.team-impact b {
  color: #dce6ff;
}

.team-card p {
  min-height: 42px;
  color: #cbd1cd;
  font-size: 11px;
  line-height: 1.35;
}

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

.team-actions span {
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  background: rgba(255,255,255,.045);
  font-size: 10px;
}

.settings-section-head {
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-section-head h3 {
  font-size: 13px;
}

.settings-section-head p {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
}

.settings-section-head button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 30px;
  padding: 5px 10px;
  color: #dce3df;
  background: #242825;
  font: inherit;
  font-size: 12px;
}

.scheduled-task-list {
  padding: 7px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.scheduled-task {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 9px;
  background: #242725;
  display: grid;
  gap: 7px;
}

.scheduled-task:hover {
  border-color: var(--line);
  background: #292c2a;
}

.scheduled-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.scheduled-time {
  color: #dce3df;
  font-size: 12px;
  font-weight: 700;
}

.scheduled-main strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.scheduled-main p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.scheduled-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scheduled-meta span {
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(255,255,255,.045);
  font-size: 11px;
}

.scheduled-foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.scheduled-foot em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--quiet);
  font-size: 11px;
  font-style: normal;
}

.task-status {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.task-status.ok {
  color: #bfe8c6;
  background: rgba(111, 191, 123, .14);
}

.task-status.watch {
  color: #ead58c;
  background: rgba(216, 184, 92, .14);
}

.task-status.critical {
  color: #ffbbb5;
  background: rgba(228, 107, 97, .14);
}

.scheduled-edit,
.scheduled-editor-actions button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 28px;
  padding: 5px 9px;
  color: #dce3df;
  background: #242825;
  font: inherit;
  font-size: 11px;
}

.scheduled-editor {
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.scheduled-editor[hidden] {
  display: none;
}

.scheduled-editor label {
  display: grid;
  gap: 5px;
}

.scheduled-editor label:nth-child(3),
.scheduled-editor label:nth-child(5),
.scheduled-editor label:nth-child(6),
.scheduled-editor-actions {
  grid-column: 1 / -1;
}

.scheduled-editor span {
  color: var(--muted);
  font-size: 11px;
}

.scheduled-editor input,
.scheduled-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 8px;
  color: var(--text);
  background: #191b1a;
  font: inherit;
  font-size: 12px;
  outline: none;
  resize: vertical;
}

.scheduled-editor textarea {
  line-height: 1.4;
}

.scheduled-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.scheduled-editor-actions .secondary {
  color: var(--muted);
  background: transparent;
}

.work-row-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.work-row-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
}

.work-row-main span,
.work-row-side small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.work-row-side {
  display: flex;
  align-items: center;
  gap: 6px;
}

.work-row-side em {
  border-radius: 999px;
  padding: 2px 6px;
  color: #cbd6d0;
  background: rgba(255,255,255,.07);
  font-style: normal;
  font-size: 10px;
}

.timeline-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.timeline-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--card);
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
}

.timeline-button {
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.timeline-button:hover {
  background: var(--card-hover);
}

.timeline-row.overdue {
  border-color: rgba(228, 107, 97, .42);
  background: rgba(228, 107, 97, .07);
}

.timeline-row.calendar-event {
  border-color: rgba(95, 141, 255, .28);
  background: rgba(95, 141, 255, .055);
}

.timeline-row.notification-event {
  border-color: rgba(216, 184, 92, .22);
  background: rgba(216, 184, 92, .045);
}

.timeline-row.operation-event {
  border-color: rgba(154, 199, 188, .26);
  background: rgba(154, 199, 188, .052);
}

.calendar-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.calendar-warning {
  border: 1px solid rgba(216, 184, 92, .28);
  border-radius: var(--radius);
  padding: 8px 9px;
  color: #dfcf8d;
  background: rgba(216, 184, 92, .08);
  font-size: 12px;
}

.month-calendar {
  min-height: 0;
}

.month-weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-weekdays {
  margin: 8px 0 4px;
  color: var(--quiet);
  font-size: 10px;
}

.month-weekdays span {
  padding: 0 7px;
}

.month-grid {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.month-cell {
  min-height: 104px;
  padding: 7px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.018);
}

.month-cell:nth-child(7n) {
  border-right: 0;
}

.month-cell:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.month-cell.muted {
  color: var(--quiet);
  background: rgba(255,255,255,.01);
}

.month-cell.today {
  background: rgba(95, 141, 255, .06);
}

.month-cell > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
}

.month-items {
  display: grid;
  gap: 3px;
}

.month-item {
  min-width: 0;
  border: 0;
  border-radius: 5px;
  padding: 3px 5px;
  color: #dce2de;
  background: rgba(216, 184, 92, .08);
  text-align: left;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-item.calendar-event {
  background: rgba(95, 141, 255, .1);
}

.month-item.operation-event {
  background: rgba(154, 199, 188, .105);
}

.month-item span {
  margin-right: 4px;
  color: var(--quiet);
}

.month-items em {
  color: var(--quiet);
  font-style: normal;
  font-size: 10px;
}

.timeline-row b {
  margin-right: 6px;
  color: #dfe4e0;
  font-weight: 650;
}

.audit-row span {
  display: grid;
  gap: 3px;
}

.audit-row small {
  color: var(--quiet);
  font-size: 10px;
}

.history-message {
  align-items: start;
}

.history-message.ok {
  border-color: rgba(154, 199, 188, .22);
}

.history-message.watch {
  border-color: rgba(216, 184, 92, .28);
  background: rgba(216, 184, 92, .045);
}

.history-message.critical {
  border-color: rgba(228, 107, 97, .35);
  background: rgba(228, 107, 97, .055);
}

.history-message pre {
  max-height: 190px;
  margin: 6px 0 0;
  padding: 8px;
  overflow: auto;
  border-radius: var(--radius);
  color: #cdd4d0;
  background: rgba(0,0,0,.16);
  white-space: pre-wrap;
  font: inherit;
  font-size: 11px;
  line-height: 1.35;
}

.empty {
  min-height: 34px;
  border: 1px dashed #343936;
  border-radius: var(--radius);
  padding: 8px;
  color: var(--quiet);
  background: transparent;
  font-size: 12px;
}

.empty.small {
  padding: 7px;
  font-size: 11px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0,0,0,.36);
}

.case-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(500px, 94vw);
  border-left: 1px solid var(--line);
  background: #202220;
  box-shadow: -24px 0 70px rgba(0,0,0,.34);
  overflow: auto;
}

.drawer-content {
  min-height: 100%;
}

.case-detail {
  padding: 14px 18px 18px;
  display: grid;
  gap: 12px;
}

.drawer-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  line-height: 1;
}

.drawer-close:hover {
  color: var(--text);
  background: var(--card);
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding-bottom: 5px;
}

.detail-markers {
  min-height: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.detail-flag,
.detail-tag {
  min-height: 20px;
  border-radius: 5px;
  padding: 2px 6px 2px 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #cfd5d1;
  background: rgba(255,255,255,.045);
  font-size: 11px;
  line-height: 1.2;
}

.detail-flag .flag-dot,
.detail-tag .tag-dot {
  width: 13px;
  height: 13px;
}

.detail-flag {
  color: #e1e4e1;
}

.detail-tag[data-color="mint"] { color: #bddbd5; background: rgba(154, 199, 188, .10); }
.detail-tag[data-color="green"] { color: #c2e8cc; background: rgba(68, 208, 123, .09); }
.detail-tag[data-color="yellow"] { color: #e2cf8d; background: rgba(216, 184, 92, .10); }
.detail-tag[data-color="red"] { color: #efc2bd; background: rgba(228, 107, 97, .10); }
.detail-tag[data-color="blue"] { color: #c8d4ff; background: rgba(101, 134, 255, .11); }
.detail-tag[data-color="gray"] { color: #c3c9c5; background: rgba(140, 147, 142, .10); }

.title-field,
.client-field {
  width: 100%;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  outline: none;
}

.title-field {
  color: var(--text);
  font-size: 21px;
  line-height: 1.18;
  font-weight: 700;
}

.client-field,
.detail-client-row,
.detail-top-grid,
.detail-supplier-grid,
.detail-scope {
  color: var(--quiet);
  font-size: 13px;
  line-height: 1.35;
}

.detail-client-row {
  margin-top: 5px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.detail-client-row span {
  color: var(--quiet);
  font-size: 12px;
}

.client-field {
  color: #d6dad7;
}

.detail-top-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 125px;
  gap: 14px;
}

.detail-supplier-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(96px, .8fr) 118px;
  gap: 14px;
}

.detail-top-grid label,
.detail-supplier-grid label,
.detail-scope {
  display: grid;
  gap: 2px;
  color: var(--quiet);
  font-size: 11px;
}

.detail-scope {
  display: block;
  margin-top: 14px;
  color: var(--quiet);
}

.detail-scope h3 {
  margin: 0 0 4px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.title-field:focus,
.client-field:focus {
  border-bottom-color: #5f8dff;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-source-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 26px;
  padding: 4px 7px;
  color: #dce3df;
  background: #242825;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.detail-source-action svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.detail-source-action:disabled {
  cursor: default;
  opacity: .45;
}

.detail-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 6px 0 8px;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1;
}

.detail-block {
  display: grid;
  gap: 8px;
}

.detail-note,
.detail-link,
.detail-draft {
  display: grid;
  gap: 3px;
  color: var(--quiet);
  font-size: 11px;
}

.client-detail-summary {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  color: #d7ddd9;
  font-size: 13px;
  line-height: 1.55;
}

.client-detail-summary div {
  display: block;
}

.client-detail-summary strong {
  margin-right: 5px;
  color: var(--text);
  font-weight: 700;
}

.client-detail-summary span {
  color: #d9dfdb;
}

.detail-draft {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 0;
  gap: 8px;
}

.detail-draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-draft-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.detail-draft-head strong,
.draft-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-draft-head strong {
  color: var(--text);
  font-size: 12px;
}

.draft-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.draft-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 28px;
  padding: 5px 7px;
  color: #dce3df;
  background: #242825;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.draft-actions svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.draft-actions button:disabled {
  cursor: default;
  opacity: .45;
}

.note-field,
.draft-body,
.link-field,
.value-field,
.deadline-field,
.supplier-field,
.supplier-cost-field,
.supplier-deadline-field,
.scope-field {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #343936;
  border-radius: 0;
  padding: 5px 0 6px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  outline: none;
}

.scope-field {
  min-height: 88px;
  resize: vertical;
  color: #dce1dd;
  line-height: 1.42;
  border-bottom: 0;
  padding-top: 2px;
  white-space: pre-wrap;
}

.detail-automation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 0;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.detail-automation-badge span {
  font-size: 11px;
  opacity: .72;
}

.detail-automation-badge em {
  font-style: normal;
  color: var(--quiet);
}

.deadline-field.is-empty-date::-webkit-datetime-edit,
.supplier-deadline-field.is-empty-date::-webkit-datetime-edit {
  color: transparent;
}

.deadline-field.is-empty-date:focus::-webkit-datetime-edit,
.supplier-deadline-field.is-empty-date:focus::-webkit-datetime-edit {
  color: transparent;
}

.note-field {
  margin-top: 4px;
  border-bottom: 0;
  padding: 4px 0;
  resize: vertical;
  min-height: 390px;
  color: #dce1dd;
  line-height: 1.45;
}

.draft-body {
  min-height: 160px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px;
  resize: vertical;
  color: #dce1dd;
  background: #1f2220;
}

.draft-source {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}

.draft-source-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.draft-source-head strong {
  color: var(--text);
  font-size: 12px;
}

.draft-source-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-source-body {
  max-height: 180px;
  overflow: auto;
  border-left: 2px solid #3a403b;
  padding-left: 9px;
  color: #b7c0ba;
}

.draft-source-subject {
  margin-bottom: 4px;
  color: #dce1dd;
  font-size: 12px;
  font-weight: 600;
}

.draft-source-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.draft-source-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.note-field:focus,
.link-field:focus,
.value-field:focus,
.deadline-field:focus,
.supplier-field:focus,
.supplier-cost-field:focus,
.supplier-deadline-field:focus,
.scope-field:focus {
  border-bottom-color: #5f8dff;
}

.card-menu,
.tag-menu {
  position: fixed;
  z-index: 60;
  width: 250px;
  border: 1px solid #3b3f3d;
  border-radius: 10px;
  padding: 5px;
  background: #202220;
  box-shadow: 0 18px 55px rgba(0,0,0,.42);
}

.menu-section {
  padding: 4px 0;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 2px;
}

.column-automation-menu {
  gap: 7px;
}

.column-automation-menu label {
  display: grid;
  gap: 4px;
  color: var(--quiet);
  font-size: 11px;
}

.column-automation-menu input,
.column-automation-menu textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 7px;
  color: var(--text);
  background: #191b1a;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.column-automation-menu textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.4;
}

.column-automation-menu input:focus,
.column-automation-menu textarea:focus {
  border-color: #4b6f61;
}

.menu-section:last-child {
  border-bottom: 0;
}

.menu-section strong {
  padding: 3px 8px;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.25;
}

.tag-edit-input {
  width: calc(100% - 16px);
  height: 30px;
  margin: 0 8px 5px;
  border: 0;
  border-bottom: 1px solid #3a3f3b;
  border-radius: 0;
  padding: 2px 0;
  color: #f0f2ef;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  outline: none;
}

.tag-edit-input:focus {
  border-bottom-color: #5f8dff;
}

.card-menu button,
.tag-menu button {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: var(--radius);
  padding: 5px 8px;
  color: #e2e6e3;
  background: transparent;
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
}

.card-menu button:hover,
.card-menu button.active,
.tag-menu button:hover,
.tag-menu button.active {
  background: var(--nav-soft);
}

.card-menu button.danger {
  color: #ffbab4;
}

.primary-menu-action {
  margin-top: 3px;
  color: #dfe7ff !important;
}

.flag-grid,
.menu-tags,
.move-menu,
.color-grid {
  display: grid;
  gap: 2px;
}

.move-menu {
  max-height: 260px;
  overflow: auto;
}

.submenu-wrap {
  position: relative;
}

.submenu-trigger {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.submenu-trigger span {
  color: var(--quiet);
}

.submenu-panel {
  position: absolute;
  top: -5px;
  left: 100%;
  width: 238px;
  border: 1px solid #3b3f3d;
  border-radius: 10px;
  padding: 5px;
  background: #202220;
  box-shadow: 0 18px 55px rgba(0,0,0,.42);
  display: none;
  z-index: 70;
}

.submenu-wrap:hover .submenu-panel,
.submenu-wrap.open .submenu-panel {
  display: grid;
}

.flag-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 3px 6px 6px;
}

.flag-choice,
.tag-menu-choice,
.move-choice,
.color-choice {
  display: flex !important;
  align-items: center;
  gap: 9px;
}

.move-choice span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-choice em {
  color: #5f8dff;
  font-style: normal;
  font-weight: 750;
}

.tag-menu-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-check {
  color: #5f8dff;
  font-weight: 700;
  min-width: 12px;
  text-align: right;
}

.menu-check {
  position: absolute;
  right: 4px;
  bottom: 2px;
  min-width: 10px;
  color: #e9edf0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.flag-choice {
  position: relative;
  min-height: 38px !important;
  justify-content: center;
  padding: 7px !important;
}

.flag-choice.active {
  background: rgba(95, 141, 255, .14) !important;
}

.flag-dot {
  position: relative;
  width: 26px;
  height: 25px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--flag-color, #d8ded9);
  background: transparent;
}

.flag-dot svg {
  width: 100%;
  height: 100%;
  display: block;
}

.flag-dot path {
  fill: var(--flag-color, currentColor);
  stroke: var(--flag-color, currentColor);
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.flag-dot[data-flag=""] {
  opacity: .9;
}

.flag-dot[data-flag=""] .flag-cloth {
  fill: none;
}

.tag-dot {
  width: 13px;
  height: 13px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--tag-color, #888f89);
  background: transparent;
  opacity: .95;
}

.timer-pill {
  min-height: 30px;
  max-width: 360px;
  border: 1px solid #3a413d;
  border-radius: var(--radius);
  padding: 5px 6px 5px 8px;
  color: #e4ebe6;
  background: #222724;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.timer-pill[hidden] { display: none; }

.timer-pill strong {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.timer-pill em {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.timer-pill button {
  border: 0;
  border-radius: 6px;
  padding: 4px 7px;
  color: #ffd8d5;
  background: rgba(239, 62, 56, .16);
  font: inherit;
  font-size: 11px;
}

.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ef3e38;
  box-shadow: 0 0 0 3px rgba(239, 62, 56, .16);
}

.time-app {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 10px;
}

.time-sidebar,
.time-detail {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.time-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.time-sidebar-head {
  min-height: 54px;
  border-bottom: 1px solid var(--line-soft);
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.time-sidebar-head h2 {
  font-size: 13px;
}

.time-sidebar-head p {
  margin-top: 2px;
  color: var(--quiet);
  font-size: 11px;
}

.time-sidebar-head button,
.time-actions button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 28px;
  padding: 5px 9px;
  color: #dce3df;
  background: #242825;
  font: inherit;
  font-size: 12px;
}

.time-actions button.danger {
  color: #ffd9d6;
  border-color: rgba(239, 62, 56, .45);
  background: rgba(239, 62, 56, .14);
}

.time-actions button.subtle {
  color: #e7aaa5;
  background: transparent;
}

.time-project-list {
  min-height: 0;
  overflow: auto;
  padding: 5px;
  display: grid;
  align-content: start;
  gap: 1px;
}

.time-project-row {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  color: inherit;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.time-project-open {
  min-width: 0;
  min-height: 42px;
  border: 0;
  padding: 7px 8px;
  color: inherit;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  font: inherit;
}

.time-project-row:hover,
.time-project-row.active {
  background: var(--card-hover);
}

.time-project-row.archived {
  opacity: .58;
}

.time-project-open span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.time-project-open strong,
.time-project-open small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-project-open strong {
  color: var(--text);
  font-size: 12px;
}

.time-project-open small,
.time-project-open em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.time-project-actions {
  padding-right: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity .12s ease;
}

.time-project-row:hover .time-project-actions,
.time-project-row.active .time-project-actions {
  opacity: 1;
}

.time-project-actions button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.time-project-actions button:hover {
  color: var(--text);
  background: #30342f;
}

.time-detail {
  padding: 14px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.time-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.time-detail-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.time-title-input,
.time-client-input,
.time-price-input,
.time-stats input,
.time-options input[type="number"] {
  border: 0;
  border-bottom: 1px solid #343936;
  border-radius: 0;
  padding: 4px 0 5px;
  color: var(--text);
  background: transparent;
  font: inherit;
  outline: none;
}

.time-title-input {
  font-size: 22px;
  font-weight: 750;
}

.time-client-input {
  color: var(--muted);
  font-size: 13px;
}

.time-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-stats {
  max-width: 720px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.035);
}

.time-stats > *,
.time-stats label {
  min-height: 56px;
  border-right: 1px solid var(--line-soft);
  padding: 9px 12px;
  display: grid;
  align-content: center;
  gap: 5px;
}

.time-stats > *:last-child {
  border-right: 0;
}

.time-stats span,
.time-options {
  color: var(--quiet);
  font-size: 10px;
  text-transform: uppercase;
}

.time-stats strong {
  color: #f0f3f0;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.time-options {
  display: flex;
  align-items: center;
  gap: 14px;
  text-transform: none;
}

.time-options label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-options input[type="number"] {
  width: 42px;
  text-align: center;
}

.time-chart {
  min-height: 260px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px;
  display: flex;
  align-items: end;
  gap: 18px;
}

.time-chart span {
  width: 84px;
  max-height: 230px;
  border-radius: 8px 8px 0 0;
  background: #ef4e4a;
}

.time-chart em {
  color: var(--quiet);
  font-style: normal;
  font-size: 12px;
}

.time-entry-list {
  max-width: 720px;
  display: grid;
  gap: 1px;
}

.time-entry-list article {
  min-height: 34px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 130px 90px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.time-entry-list strong,
.time-entry-list span {
  color: #dfe4e0;
  font-weight: 600;
}

.time-entry-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--quiet);
  font-style: normal;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 44px 160px minmax(0, 1fr);
  }

  .now-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline-board {
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  body { overflow: auto; }

  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .icon-rail {
    display: none;
  }

  .sidebar {
    grid-template-rows: auto auto auto;
  }

  .sidebar-scroll {
    overflow: visible;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    height: auto;
  }

  .workspace-head {
    align-items: start;
    flex-direction: column;
  }

  .now-list {
    grid-template-columns: 1fr;
  }

  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .timeline-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-top-grid,
  .detail-supplier-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
