:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #182025;
  --muted: #69757d;
  --line: #dce3e6;
  --accent: #166c7d;
  --accent-dark: #0e5060;
  --danger: #a33a2b;
  --success: #2d7a46;
  --topbar-height: 61px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 60px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 14px 28px;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 16px;
}

.topbar form {
  margin: 0;
}

.mobile-topbar-menu {
  display: none;
  position: relative;
}

.mobile-topbar-menu summary {
  list-style: none;
}

.mobile-topbar-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-topbar-menu > nav {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(24, 32, 37, 0.18);
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
}

.mobile-topbar-menu > nav a,
.mobile-topbar-menu > nav button {
  display: flex;
  justify-content: flex-start;
  min-height: 44px;
  padding: 11px 12px;
  width: 100%;
}

.impersonation-banner {
  align-items: center;
  background: #fff7e8;
  border-bottom: 1px solid #ead7b8;
  color: #6f4a12;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 10px 28px;
}

.impersonation-banner form {
  margin: 0;
}

.impersonation-banner button {
  background: #8b5e17;
  padding: 7px 11px;
}

.impersonation-banner button:hover {
  background: #6f4a12;
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px;
}

.page:has(.app-shell) {
  margin: 0;
  max-width: none;
  padding: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.content-area {
  min-width: 0;
  overflow: hidden;
  padding: 28px;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: calc(100vh - var(--topbar-height));
  overflow: hidden;
  padding: 12px;
  position: sticky;
  top: 0;
}

.app-shell.sidebar-collapsed .side-nav {
  display: none;
}

.sidebar-toggle {
  align-items: center;
  aspect-ratio: 1;
  background: #e8eef0;
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 18px;
  box-shadow: 0 10px 24px rgba(24, 32, 37, 0.14);
  color: var(--text);
  display: inline-flex;
  justify-content: center;
  left: calc(var(--sidebar-width) - 18px);
  padding: 0;
  position: fixed;
  width: 36px;
  z-index: 30;
}

.sidebar-toggle:hover {
  background: #dce6e9;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  left: calc(var(--sidebar-collapsed-width) - 18px);
}

.sidebar-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.icon-button {
  align-items: center;
  aspect-ratio: 1;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #7c8a90;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  opacity: 0.72;
  padding: 0;
  transition: background-color 120ms ease, color 120ms ease, opacity 120ms ease;
  width: 32px;
}

.icon-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #eef3f4;
  color: var(--text);
  opacity: 1;
}

.danger-icon-button {
  background: transparent;
  color: #8a979d;
}

.danger-icon-button:hover,
.danger-icon-button:focus-visible {
  background: #fbecea;
  color: var(--danger);
}

.side-nav {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-client-switcher {
  border-bottom: 1px solid var(--line);
  margin: 0 0 8px;
  padding: 0 0 12px;
}

.sidebar-client-switcher label {
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
  text-transform: uppercase;
  margin: 4px;
}

.sidebar-client-switcher select {
  background: #f8fafb;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
  text-transform: none;
}

.sidebar-client-switcher select:focus-visible {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(22, 108, 125, 0.22);
  outline: none;
}

.sidebar-search {
  margin: 0 0 8px;
}

.sidebar-search label {
  margin: 0;
}

.sidebar-search input {
  background: #f8fafb;
  font-size: 14px;
  padding: 9px 10px;
}

.search-result-panel + .search-result-panel {
  margin-top: 18px;
}

.side-nav a,
.side-label {
  border-radius: 6px;
  color: var(--text);
  display: block;
  padding: 8px 10px;
}

.mobile-workspace-menu {
  display: none;
}

.mobile-admin-nav-label {
  display: none;
}

.side-nav a.active,
.side-nav a:hover {
  background: #e8f2f4;
  text-decoration: none;
}

.side-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 10px;
  text-transform: uppercase;
}

.page-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

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

.actions.compact {
  align-items: center;
  gap: 8px;
}

.actions.compact form {
  margin: 0;
}

.actions.align-end {
  align-items: flex-end;
}

.inline-filter {
  margin: 0;
}

.inline-filter label {
  gap: 6px;
  min-width: 180px;
}

.inline-filter select {
  min-height: 38px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

p {
  color: var(--muted);
}

.panel,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.empty-state.compact {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

.empty-state h2,
.empty-state h3,
.empty-state p {
  margin-bottom: 0;
}

.search-panel {
  align-items: flex-end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1fr) auto auto auto;
  margin-bottom: 18px;
}

.search-panel label {
  margin: 0;
}

.search-label-copy {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.search-help-tooltip {
  align-items: center;
  background: #e8eef0;
  border-radius: 999px;
  color: #56676e;
  cursor: help;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 16px;
  justify-content: center;
  line-height: 1;
  position: relative;
  width: 16px;
}

.search-help-tooltip-content {
  background: var(--text);
  border-radius: 6px;
  bottom: calc(100% + 8px);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  left: 50%;
  line-height: 1.4;
  max-width: min(360px, calc(100vw - 40px));
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
  visibility: hidden;
  white-space: normal;
  width: max-content;
  z-index: 20;
}

.search-help-tooltip:hover .search-help-tooltip-content,
.search-help-tooltip:focus .search-help-tooltip-content,
.search-help-tooltip:focus-visible .search-help-tooltip-content {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.search-action-button {
  height: 36px;
  width: 36px;
}

.search-input-wrap {
  display: block;
  position: relative;
}

.search-input-wrap input {
  padding-right: 42px;
}

.search-clear-link {
  align-items: center;
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  height: 28px;
  justify-content: center;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
}

.search-clear-link:hover,
.search-clear-link:focus-visible {
  background: #eef3f4;
  color: var(--text);
  text-decoration: none;
}

.search-clear-link svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.task-results-panel {
  display: grid;
  gap: 16px;
}

.column-menu {
  position: relative;
}

.column-menu summary {
  list-style: none;
}

.column-menu summary::-webkit-details-marker {
  display: none;
}

.column-menu-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(24, 32, 37, 0.16);
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.column-menu-form label {
  align-items: center;
  color: var(--text);
  display: flex;
  flex-direction: row;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  text-transform: none;
  white-space: nowrap;
}

.column-menu-form label:hover {
  background: #f5f8f9;
}

.column-menu-form input {
  width: auto;
}

.saved-search-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.saved-search-panel h2,
.saved-search-panel h3,
.saved-search-panel p {
  margin-bottom: 0;
}

.saved-search-form {
  align-items: flex-end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) auto;
}

.saved-search-form label {
  margin: 0;
}

.saved-search-discovery {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.saved-search-list {
  display: grid;
  gap: 8px;
}

.saved-search-list article {
  align-items: center;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.saved-search-list article div {
  display: grid;
  gap: 3px;
}

.saved-search-list small {
  color: var(--muted);
}

.saved-search-list form {
  margin: 0;
}

.result-summary {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.result-summary h2,
.result-summary p {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
}

.task-results-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.task-results-table th,
.task-results-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.task-results-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.task-results-table tbody tr:hover {
  background: #f8fafb;
}

.dashboard-head {
  align-items: center;
}

.dashboard-title-row {
  align-items: center;
  display: flex;
  gap: 7px;
}

.dashboard-title-row h1 {
  margin: 0;
}

.dashboard-customize-button {
  background: transparent;
  border: 0;
  color: #89969b;
  min-height: 32px;
  min-width: 32px;
  opacity: 0.72;
}

.dashboard-customize-button:hover,
.dashboard-customize-button:focus-visible {
  background: #eef3f4;
  color: var(--text);
  opacity: 1;
}

.dashboard-customize-button svg,
.dashboard-widget-edit svg,
.dashboard-layout-control svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dashboard-dirty-indicator {
  background: var(--accent);
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.dashboard-edit-actions {
  align-items: center;
  display: flex;
  gap: 7px;
}

.dashboard-add-widget {
  padding: 7px 10px;
}

.dashboard-layout-control {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  margin: 0;
  padding: 2px;
}

.dashboard-layout-control button {
  background: transparent;
  border: 0;
  color: #75848a;
  min-height: 30px;
  min-width: 32px;
  padding: 6px 8px;
}

.dashboard-layout-control button.active {
  background: #e8f2f4;
  color: var(--accent-dark);
}

.dashboard-edit-actions [data-dashboard-save]:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.dashboard-action-divider {
  background: var(--line);
  height: 24px;
  margin: 0 2px;
  width: 1px;
}

.dashboard-cancel-button {
  background: transparent;
  color: var(--muted);
  padding: 7px 8px;
}

.dashboard-cancel-button:hover,
.dashboard-cancel-button:focus-visible {
  background: #eef3f4;
  color: var(--text);
}

.dashboard-save-button {
  padding: 7px 12px;
}

.dashboard-more-menu {
  position: relative;
}

.dashboard-more-menu summary {
  align-items: center;
  color: #75848a;
  cursor: pointer;
  display: flex;
  justify-content: center;
  list-style: none;
  min-height: 34px;
  min-width: 34px;
}

.dashboard-more-menu summary::-webkit-details-marker {
  display: none;
}

.dashboard-more-menu summary svg {
  fill: currentColor;
}

.dashboard-more-menu-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(24, 32, 37, 0.15);
  min-width: 210px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
}

.dashboard-more-menu-panel button {
  background: transparent;
  color: var(--text);
  justify-content: flex-start;
  padding: 9px 10px;
  width: 100%;
}
.dashboard-grid {
  align-items: start;
  display: grid;
  gap: 18px;
}

.dashboard-grid.columns-1 {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-grid.columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-column {
  align-content: start;
  display: grid;
  gap: 14px;
  min-height: 160px;
}

.dashboard-grid.editing .dashboard-column {
  min-height: 130px;
}

.dashboard-grid.editing .dashboard-widget {
  border-color: #cbd7da;
}

.dashboard-grid.editing .dashboard-widget:hover,
.dashboard-grid.editing .dashboard-widget:focus-within {
  border-color: #9cb9bf;
  box-shadow: 0 5px 16px rgba(24, 32, 37, 0.07);
}

.dashboard-column.drag-over {
  background: #e8f2f4;
}

.dashboard-widget {
  display: grid;
  gap: 10px;
}

.dashboard-widget.dragging {
  box-shadow: 0 14px 30px rgba(24, 32, 37, 0.16);
  opacity: 0.62;
}

.dashboard-widget-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.dashboard-widget-head h2 {
  margin: 0;
}

.dashboard-widget-actions {
  align-items: center;
  display: flex;
  gap: 2px;
  opacity: 0.45;
  transition: opacity 120ms ease;
}

.dashboard-widget:hover .dashboard-widget-actions,
.dashboard-widget:focus-within .dashboard-widget-actions {
  opacity: 1;
}

.dashboard-widget-drag,
.dashboard-widget-edit {
  min-height: 36px;
  min-width: 36px;
}

.dashboard-widget-drag {
  background: transparent;
  border: 0;
  color: #8a979d;
  cursor: grab;
}

.dashboard-widget-drag:active {
  cursor: grabbing;
}

.dashboard-widget-drag svg {
  fill: currentColor;
}

.dashboard-widget-edit {
  background: transparent;
  border: 0;
  color: #8a979d;
  opacity: 0.68;
  width: 26px;
}

.dashboard-widget-edit:hover,
.dashboard-widget-edit:focus-visible {
  background: transparent;
  color: var(--text);
  opacity: 1;
}

.dashboard-widget-edit svg {
  width: 14px;
}

.dashboard-widget-body p {
  margin-bottom: 0;
}

.dashboard-item-list {
  display: grid;
  gap: 8px;
}

.dashboard-task-row,
.dashboard-note-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  text-decoration: none;
}

.dashboard-task-row:hover,
.dashboard-note-row:hover {
  background: #f8fafb;
}

.dashboard-task-row strong,
.dashboard-note-row strong {
  color: var(--text);
}

.dashboard-task-fields {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
}

.dashboard-note-row small,
.dashboard-note-row span {
  color: var(--muted);
}

.dashboard-labels {
  font-size: 12px;
}

.dashboard-widget-modal {
  gap: 12px;
  max-height: calc(100vh - 48px);
  max-width: min(520px, calc(100vw - 32px));
  overflow-y: auto;
  padding: 18px;
}

.dashboard-widget-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 8px 10px 10px;
}

.dashboard-widget-fieldset legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  justify-content: space-between;
  padding: 0 4px;
  text-transform: uppercase;
  width: 100%;
}

.dashboard-widget-fieldset .text-button {
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  padding: 0 0 0 8px;
  text-transform: none;
}

.dashboard-widget-fieldset .text-button:hover {
  background: transparent;
  color: var(--accent-dark);
}

.dashboard-widget-fieldset .checkbox-line {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  gap: 6px;
  justify-content: flex-start;
  line-height: 1.25;
  min-height: 24px;
}

.dashboard-widget-fieldset .checkbox-line input {
  accent-color: var(--accent);
  flex: 0 0 auto;
  height: 15px;
  margin: 0;
  padding: 0;
  width: 15px;
}

.dashboard-widget-context {
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.dashboard-label-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -4px;
}

.dashboard-label-option-list .label-pill {
  border: 0;
  color: var(--accent-dark);
  padding: 6px 8px;
  width: auto;
}

.dashboard-links-widget {
  display: grid;
  gap: 10px;
}

.dashboard-link-list {
  display: grid;
  gap: 3px;
}

.dashboard-link-row,
.dashboard-link-editor {
  align-items: center;
  display: grid;
  gap: 8px;
}

.dashboard-link-row {
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 -5px;
  min-height: 32px;
  padding: 2px 5px;
}

.dashboard-link-row[hidden] {
  display: none;
}

.dashboard-link-row:hover,
.dashboard-link-row:focus-within {
  background: #f8fafb;
  border-radius: 7px;
}

.dashboard-link-row a {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-link-type-icon {
  color: #718087;
  display: inline-flex;
  flex: 0 0 auto;
}

.dashboard-link-type-icon svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 15px;
}

.dashboard-link-actions {
  align-items: center;
  display: flex;
  gap: 1px;
  opacity: 0.45;
  transition: opacity 120ms ease;
}

.dashboard-link-row:hover .dashboard-link-actions,
.dashboard-link-row:focus-within .dashboard-link-actions {
  opacity: 1;
}

.dashboard-link-actions .icon-button,
.dashboard-link-delete,
.dashboard-link-save,
.dashboard-link-edit,
.dashboard-link-move {
  background: transparent;
  border: 0;
  color: #8a979d;
  min-height: 26px;
  width: 26px;
}

.dashboard-link-actions .icon-button:hover,
.dashboard-link-actions .icon-button:focus-visible,
.dashboard-link-delete:hover,
.dashboard-link-save:hover,
.dashboard-link-edit:hover,
.dashboard-link-move:hover {
  background: transparent;
  color: var(--text);
}

.dashboard-link-actions .icon-button:disabled {
  color: #c6ced1;
  cursor: default;
  opacity: 0.5;
}

.dashboard-link-actions .dashboard-link-delete:hover,
.dashboard-link-actions .dashboard-link-delete:focus-visible {
  color: var(--danger);
}

.dashboard-link-editor {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) auto auto;
  margin: 3px 0;
  padding: 7px;
}

.dashboard-link-editor input {
  background: var(--panel);
  min-width: 0;
  padding: 7px 9px;
}

.dashboard-link-add {
  background: #e8eef0;
  border: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 400;
  height: 28px;
  justify-self: start;
  line-height: 1;
  width: 28px;
}

.dashboard-link-add:hover,
.dashboard-link-add:focus-visible {
  background: #dce6e9;
}

.dashboard-link-note-options {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 32, 37, 0.14);
  display: grid;
  grid-column: 2 / 5;
  max-height: 210px;
  overflow-y: auto;
  z-index: 10;
}

.dashboard-link-note-options button {
  background: transparent;
  border-radius: 0;
  color: var(--text);
  justify-content: flex-start;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.dashboard-link-note-options button:hover {
  background: #f8fafb;
}

.dashboard-widget-settings-note {
  margin: 0;
}

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

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.data-table th a {
  color: inherit;
}

.sort-link {
  align-items: center;
  border-radius: 5px;
  display: inline-flex;
  gap: 6px;
  padding: 3px 5px;
}

.sort-link:hover,
.sort-link:focus-visible,
.sort-link.active {
  background: #e8f2f4;
  color: var(--text);
  text-decoration: none;
}

.data-table tbody tr:hover {
  background: #f8fafb;
}

.note-filter-panel {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto auto;
}

.note-filter-panel > label,
.note-filter-panel > .label-filter,
.note-filter-panel .label-filter-input,
.note-filter-panel .label-filter-input input {
  min-width: 0;
}

.note-page-head {
  margin-bottom: 18px;
}

.note-table-panel {
  min-width: 0;
}

.note-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.note-table {
  min-width: 620px;
}

.feature-subsettings {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 6px 0 0 44px;
  padding: 14px;
}

.feature-subsettings legend {
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
}

.time-tracking-mode-options {
  border: 0;
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
}

.time-tracking-mode-options > label {
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  padding: 12px;
}

.time-tracking-mode-options > label input[type="radio"] {
  flex: 0 0 auto;
  margin-top: 3px;
  width: auto;
}

.time-tracking-mode-options > label span,
.time-tracking-mode-options > label small {
  display: block;
}

.feature-subsettings > .grid {
  margin-bottom: 0;
}

.time-page-head {
  margin-bottom: 12px;
}

.time-week-nav {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 14px;
}

.time-week-nav .icon-button {
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
}

.time-entry-panel {
  min-width: 0;
}

.time-entry-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.time-entry-table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

.time-entry-table th,
.time-entry-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
  text-align: center;
}

.time-entry-table th:first-child {
  min-width: 220px;
  text-align: left;
}

.time-entry-table thead th span,
.time-entry-table thead th small,
.time-entry-table tbody th small {
  display: block;
}

.time-entry-table thead th small,
.time-entry-table tbody th small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.time-entry-table input {
  min-width: 64px;
  padding: 7px 6px;
  text-align: right;
  width: 72px;
}

.time-entry-table input.saving {
  opacity: 0.65;
}

.time-entry-table input.error {
  border-color: var(--danger);
}

.time-entry-status {
  margin: 10px 0 0;
  text-align: right;
}

.note-detail {
  margin: 0 auto;
  max-width: 920px;
}

.note-detail-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
}

.note-detail-head h1 {
  margin-bottom: 6px;
}

.note-detail-head form {
  margin: 0;
}

.note-body {
  color: var(--text);
  line-height: 1.6;
  min-height: 160px;
}

.note-form {
  margin: 0 auto;
  max-width: 980px;
}

.note-form .sun-editor {
  border-color: var(--line);
}

.auth-panel {
  margin: 12vh auto 0;
  max-width: 380px;
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 14px;
}

form.stack > button {
  justify-self: start;
}

.compact-stack {
  gap: 10px;
}

.app-admin-sections {
  display: grid;
  gap: 18px;
}

.toggle-row {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 14px;
}

.toggle-row input {
  margin-top: 3px;
  width: auto;
}

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

.toggle-row strong {
  color: var(--text);
}

.toggle-row small {
  color: var(--muted);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  gap: 6px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

button,
.button {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
  line-height: 1.25;
  padding: 8px 11px;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}

.button.secondary {
  background: #edf2f3;
  color: var(--text);
}

.button.secondary:hover {
  background: #dce6e9;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}

.danger-button {
  background: transparent;
  border: 1px solid #d8a49d;
  color: var(--danger);
  padding: 7px 10px;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: #fbecea;
  border-color: var(--danger);
  color: var(--danger);
}

.topbar button {
  background: transparent;
  color: var(--muted);
  padding: 7px 9px;
}

.topbar button:hover,
.topbar button:focus-visible {
  background: #eef3f4;
  color: var(--text);
}

.modal-layer {
  inset: 0;
  position: fixed;
  z-index: 80;
}

.modal-backdrop {
  background: rgba(24, 32, 37, 0.42);
  inset: 0;
  position: absolute;
}

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(24, 32, 37, 0.24);
  display: grid;
  gap: 16px;
  left: 50%;
  max-width: min(440px, calc(100vw - 32px));
  padding: 22px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
}

.modal-icon {
  align-items: center;
  background: #e8f2f4;
  border-radius: 8px;
  color: var(--accent-dark);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.modal-icon.danger {
  background: #f7e9e6;
  color: var(--danger);
}

.modal-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.modal-copy {
  display: grid;
  gap: 6px;
}

.modal-copy h2,
.modal-copy p {
  margin: 0;
}

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

.modal-actions.split {
  align-items: center;
}

.saved-search-modal .modal-actions.split {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
}

.modal-action-spacer {
  flex: 1;
}

.visibility-toggle-field {
  gap: 8px;
}

.visibility-toggle {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 14px;
  gap: 10px;
}

.visibility-toggle input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.visibility-slider {
  background: #d8e3e7;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  height: 26px;
  padding: 3px;
  position: relative;
  transition: background 160ms ease, border-color 160ms ease;
  width: 48px;
}

.visibility-slider::after {
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(24, 32, 37, 0.18);
  content: "";
  height: 18px;
  transition: transform 160ms ease;
  width: 18px;
}

.visibility-toggle input:checked + .visibility-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.visibility-toggle input:checked + .visibility-slider::after {
  transform: translateX(20px);
}

.visibility-toggle input:focus-visible + .visibility-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feature-toggle {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 14px;
}

.feature-toggle > input[type="hidden"],
.feature-toggle > input[type="checkbox"] {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.feature-toggle > input[type="checkbox"]:checked + .visibility-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.feature-toggle > input[type="checkbox"]:checked + .visibility-slider::after {
  transform: translateX(20px);
}

.feature-toggle > input[type="checkbox"]:focus-visible + .visibility-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feature-toggle small {
  color: var(--muted);
}

.toast-region {
  bottom: 24px;
  display: grid;
  gap: 10px;
  pointer-events: none;
  position: fixed;
  right: 24px;
  width: min(360px, calc(100vw - 48px));
  z-index: 90;
}

.toast {
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(24, 32, 37, 0.16);
  color: var(--text);
  display: grid;
  gap: 3px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
  pointer-events: auto;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.danger,
.toast.error {
  border-left-color: var(--danger);
}

.toast.success {
  border-left-color: var(--accent-dark);
}

.toast strong,
.toast span {
  grid-column: 1;
}

.toast span {
  color: var(--muted);
}

.toast button {
  align-items: center;
  background: transparent;
  color: var(--muted);
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 0;
}

.toast button:hover {
  background: transparent;
  color: var(--text);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(8px);
}

.icon-link {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 6px;
  display: inline-flex;
  justify-content: center;
  width: 34px;
}

.icon-link svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-link:hover {
  background: #e8f2f4;
  text-decoration: none;
}

.metric {
  color: var(--text);
  font-size: 42px;
  font-weight: 800;
}

.list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 10px;
}

.list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.list.loose li {
  align-items: start;
  display: block;
}

.entity-list-title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entity-list-title span {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

.kanban-board {
  display: grid;
  gap: 14px;
  grid-auto-columns: minmax(260px, 1fr);
  grid-auto-flow: column;
  min-height: calc(100vh - var(--topbar-height) - 112px);
  overflow-x: auto;
  padding-bottom: 10px;
}

.mobile-kanban-tabs {
  display: none;
}

.board-filters {
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto auto;
  margin-bottom: 14px;
  padding: 12px;
}

.board-controls {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 12px;
  padding: 0 2px 10px;
}

.board-controls.has-quickfilters {
  justify-content: space-between;
}

.quickfilter-bar {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 220px;
}

.quickfilter-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quickfilter-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.quickfilter-link {
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
  text-decoration: none;
}

.quickfilter-link:hover {
  background: #eef7f7;
  text-decoration: none;
}

.quickfilter-link.active {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #ffffff;
}

.board-filter-toggle {
  flex: 0 0 auto;
}

.board-filter-toggle.active {
  background: #e8f2f4;
  border-color: var(--accent);
  color: var(--accent-dark);
}

.task-label,
.label-pill {
  background: #e8f2f4;
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 8px;
}

.kanban-column {
  background: #edf2f3;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: calc(100vh - 190px);
  min-height: 420px;
}

.kanban-column header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.kanban-column h2 {
  font-size: 15px;
  margin: 0;
}

.kanban-column header span {
  color: var(--muted);
  font-weight: 800;
}

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

.kanban-column-actions .icon-button {
  background: transparent;
  color: #7c8a90;
  height: 28px;
  width: 28px;
}

.kanban-column-actions .icon-button:hover,
.kanban-column-actions .icon-button:focus-visible {
  background: #eef3f4;
  color: var(--text);
}

.kanban-column.drag-over {
  border-color: var(--accent);
}

.kanban-stack {
  align-content: start;
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding: 10px;
}

.task-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: grab;
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  word-break: break-word;
}

.task-card-wrap {
  min-width: 0;
  position: relative;
}

.task-card-move {
  display: none;
}

.task-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.task-card:focus-visible,
.icon-button:focus-visible,
.sidebar-toggle:focus-visible,
button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(22, 108, 125, 0.35);
  outline-offset: 2px;
}

.task-card strong {
  line-height: 1.25;
  min-width: 0;
}

.task-card span,
.task-card small {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.labels-applied {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.label-filter {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  gap: 6px;
}

.label-filter-input {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.label-filter-add-button {
  align-self: center;
}

.label-filter-selected {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}

.label-filter-selected:has(.label-pill) {
  display: flex;
}

.label-pill {
  align-items: center;
  gap: 6px;
}

.label-pill button {
  align-items: center;
  aspect-ratio: 1;
  background: transparent;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 14px;
  justify-content: center;
  padding: 0;
  width: 16px;
}

.label-add-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.label-add-control {
  display: inline-flex;
  flex: 0 0 auto;
  position: relative;
}

.shelf-label-add-toggle {
  background: transparent;
  border: 0;
  color: #8a979d;
  flex: 0 0 auto;
  height: 26px;
  opacity: 0.68;
  width: 26px;
}

.shelf-label-add-toggle:hover,
.shelf-label-add-toggle:focus-visible,
.shelf-label-add-toggle[aria-expanded="true"] {
  background: transparent;
  color: var(--text);
  opacity: 1;
}

.shelf-label-add-toggle svg {
  height: 14px;
  width: 14px;
}

.label-add-popover {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(24, 32, 37, 0.16);
  margin-top: 8px;
  padding: 10px;
  position: absolute;
  left: 0;
  top: 100%;
  width: min(320px, calc(100vw - 48px));
  z-index: 5;
}

.label-add-popover .label-add-form {
  margin: 0;
}

.autosave-status,
.muted {
  color: var(--muted);
}

.autosave-status {
  min-height: 18px;
}

.autosave-status.saving {
  color: var(--muted);
}

.autosave-status.saved {
  color: var(--success);
}

.autosave-status.error {
  color: var(--danger);
}

.autosave-retry {
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
}

.autosave-retry:hover {
  background: transparent;
  color: var(--danger);
}

.user-access-list {
  display: grid;
  gap: 18px;
}

.user-access-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(180px, 1fr) minmax(0, auto);
  padding-top: 18px;
}

.user-access-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.user-access-row h2 {
  margin-bottom: 4px;
}

.user-access-row p {
  margin-bottom: 0;
}

.user-row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.user-row-actions form {
  margin: 0;
}

.assigned-clients {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-pill {
  align-items: center;
  background: #e8f2f4;
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  margin: 0;
  padding: 6px 8px;
}

.assignment-pill button {
  align-items: center;
  aspect-ratio: 1;
  background: transparent;
  color: var(--accent-dark);
  display: inline-flex;
  justify-content: center;
  padding: 0;
  width: 16px;
}

.client-assignment-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 260px) auto;
}

.task-shelf {
  inset: var(--topbar-height) 0 0 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 160ms ease;
  z-index: 20;
}

.task-shelf.open {
  opacity: 1;
  pointer-events: auto;
}

.task-shelf-backdrop {
  background: rgba(24, 32, 37, 0.28);
  inset: 0;
  position: absolute;
}

.task-shelf-panel {
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(24, 32, 37, 0.16);
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-left: auto;
  max-width: min(660px, 100vw);
  overflow: hidden;
  position: relative;
  transform: translateX(100%);
  transition: transform 180ms ease;
  width: 620px;
}

.task-shelf.open .task-shelf-panel {
  transform: translateX(0);
}

.shelf-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  min-height: 52px;
  padding: 8px 20px 8px 24px;
}

.shelf-toolbar > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.shelf-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  flex: 0 0 auto;
}

.shelf-close:hover {
  background: #edf3f4;
  border-color: var(--line);
  color: var(--text);
}

.shelf-close svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

[data-task-shelf-content] {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 28px 30px;
}

.shelf-details-grid {
  align-items: start;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 1fr);
}

.editable-title {
  border-radius: 6px;
  cursor: text;
  font-size: 23px;
  line-height: 1.25;
  margin: 0;
  padding: 5px 7px;
}

.editable-title:hover,
.editable-title:focus {
  background: #e8f2f4;
  outline: none;
}

.editable-title-input {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.25;
  padding: 7px 9px;
}

.editable-description {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: text;
  line-height: 1.45;
  min-height: 40px;
  padding: 8px 9px;
  white-space: pre-wrap;
}

.editable-description:hover,
.editable-description:focus {
  background: #e8f2f4;
  border-color: #cfe0e4;
  outline: none;
}

.editable-description-input {
  min-height: 112px;
  resize: vertical;
}

.editable-field-value,
.editable-person {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  justify-content: flex-start;
  min-height: 38px;
  padding: 7px 9px;
  text-align: left;
}

.editable-field-value:hover,
.editable-field-value:focus,
.editable-person:hover,
.editable-person:focus {
  background: #e8f2f4;
  outline: none;
}

.editable-field-value {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
}

.editable-field-value svg {
  fill: none;
  flex: 0 0 auto;
  opacity: 0.55;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.editable-field-value.muted {
  color: var(--muted);
  font-weight: 500;
}

.task-key {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.shelf-section {
  min-width: 0;
  padding: 9px 0;
}

.shelf-field {
  display: grid;
  gap: 6px;
}

.shelf-field--row {
  align-items: start;
  column-gap: 18px;
  grid-template-columns: 124px minmax(0, 1fr);
  row-gap: 2px;
}

.shelf-field--row > .field-label {
  padding-top: 10px;
}

.shelf-field--row > .editable-field-value,
.shelf-field--row > .editable-person,
.shelf-field--row > .labels-applied {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.shelf-field--row > .autosave-status {
  grid-column: 2;
}

.shelf-field.stack {
  gap: 6px;
}

.shelf-field--row.stack {
  column-gap: 18px;
  row-gap: 2px;
}

.shelf-field--wide {
  grid-column: 1 / -1;
}

.shelf-field--key {
  padding-bottom: 2px;
}

.shelf-field--key > .field-label {
  padding-top: 0;
}

.shelf-field--title {
  padding-top: 4px;
}

.shelf-field--description,
.shelf-field--labels {
  padding-bottom: 12px;
}

.shelf-field--labels .labels-applied {
  min-height: 38px;
  padding: 6px 9px;
}

.shelf-field--collection {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 18px;
}

.shelf-field--danger {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 18px;
}

.shelf-field--danger form {
  display: flex;
  justify-content: flex-start;
  margin: 0;
}

.shelf-field--danger .danger-button {
  background: transparent;
  border: 1px solid #d8a49d;
  color: var(--danger);
}

.shelf-field--danger .danger-button:hover {
  background: #fbecea;
  border-color: var(--danger);
}

.shelf-field label {
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
}

.shelf-field input,
.shelf-field select,
.shelf-field textarea {
  padding: 8px 10px;
}

.shelf-field .grid {
  gap: 8px;
  margin: 0;
}

.shelf-field .autosave-status {
  font-size: 11px;
  line-height: 1.3;
  margin: 0;
  min-height: 0;
}

.shelf-field .autosave-status:empty {
  display: none;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 4px;
  grid-template-columns: 120px minmax(0, 1fr);
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
}

.shelf-loading {
  color: var(--muted);
  padding: 28px;
}

.shelf-inline-form {
  gap: 8px;
  margin-bottom: 14px;
}

.shelf-inline-form button {
  justify-self: start;
  padding: 8px 12px;
}

.shelf-field--comments .shelf-inline-form textarea {
  min-height: 82px;
}

.mention-composer {
  display: block;
  position: relative;
}

.mention-menu {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: grid;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  position: absolute;
  z-index: 30;
}

.mention-menu[hidden] {
  display: none;
}

.mention-menu button {
  align-items: start;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 2px;
  justify-items: start;
  padding: 8px 10px;
  text-align: left;
}

.mention-menu button:hover,
.mention-menu button.active {
  background: #e8f2f4;
}

.mention-menu small,
.mention-empty {
  color: var(--muted);
  font-size: 12px;
}

.mention-empty {
  padding: 8px 10px;
}

.shelf-field--labels .labels-applied {
  align-items: center;
  margin-bottom: 0;
}

.shelf-field--attachments .shelf-inline-form {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.shelf-list {
  margin-top: 6px;
}

.shelf-list .comment-item {
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.shelf-list .comment-item + .comment-item {
  margin-top: 8px;
}

.comment-item > p {
  color: var(--text);
  line-height: 1.45;
  margin: 0;
}

.attachment-item {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.attachment-item form {
  margin: 0;
}

.comment-item header {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.comment-item header div:first-child {
  display: grid;
  gap: 3px;
}

.comment-item time {
  color: var(--muted);
  font-size: 12px;
}

.comment-actions,
.comment-edit-actions {
  display: flex;
  gap: 6px;
}

.comment-actions form {
  margin: 0;
}

.comment-edit-form {
  display: grid;
  gap: 8px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 6px;
  justify-content: flex-start;
  padding: 7px 0;
  text-align: left;
  width: 100%;
}

.history-toggle:hover,
.history-toggle:focus,
.history-toggle:focus-visible {
  background: transparent;
  box-shadow: none;
  color: inherit;
  outline: none;
}

.history-toggle-chevron {
  fill: none;
  flex: 0 0 auto;
  height: 14px;
  opacity: 0.65;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease;
  width: 14px;
}

.history-toggle[aria-expanded="true"] .history-toggle-chevron {
  transform: rotate(180deg);
}

.history-toggle .field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-item {
  border-left: 3px solid #d7e9ed;
  padding-left: 10px;
}

.history-item header {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.history-item time {
  color: var(--muted);
  font-size: 12px;
}

.history-item p {
  color: var(--muted);
  margin: 0;
}

.history-item p strong,
.history-item p span {
  color: var(--text);
}

[data-shelf-form] button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.field-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px;
}

.field-group legend {
  color: var(--muted);
  font-weight: 800;
  padding: 0 4px;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.check-row input {
  width: auto;
}

.choice-stack {
  display: grid;
  gap: 8px;
}

.board-column-editor {
  display: grid;
  gap: 10px;
}

.board-column-editor-head,
.board-column-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) auto;
}

.board-column-editor-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.board-column-list {
  display: grid;
  gap: 8px;
}

.board-column-row {
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.board-column-row input[type="text"] {
  background: var(--panel);
}

.board-column-actions {
  display: flex;
  gap: 2px;
  opacity: 0.55;
  transition: opacity 120ms ease;
}

.board-column-row:hover .board-column-actions,
.board-column-row:focus-within .board-column-actions {
  opacity: 1;
}

.custom-field-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.custom-field-editor-head,
.custom-field-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.custom-field-editor-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.custom-field-list {
  display: grid;
  gap: 8px;
}

.custom-field-row {
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.custom-field-row strong,
.custom-field-row span {
  display: block;
}

.custom-field-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.custom-field-actions {
  display: flex;
  gap: 2px;
  opacity: 0.55;
  transition: opacity 120ms ease;
}

.custom-field-row:hover .custom-field-actions,
.custom-field-row:focus-within .custom-field-actions {
  opacity: 1;
}

.custom-field-modal {
  gap: 12px;
}

.quickfilter-editor {
  display: grid;
  gap: 10px;
}

.quickfilter-editor-head {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
}

.quickfilter-list {
  display: grid;
  gap: 10px;
}

.quickfilter-row {
  align-items: start;
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.quickfilter-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.quickfilter-actions {
  display: flex;
  gap: 2px;
  opacity: 0.55;
  transition: opacity 120ms ease;
}

.quickfilter-row:hover .quickfilter-actions,
.quickfilter-row:focus-within .quickfilter-actions {
  opacity: 1;
}

.modal-field {
  display: grid;
  gap: 6px;
}

.field-display-grid {
  align-items: center;
  display: grid;
  gap: 10px 14px;
  grid-template-columns: minmax(140px, 1fr) 72px 72px 88px 86px;
}

.field-display-grid strong {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.check-cell {
  align-items: center;
  display: flex;
  justify-content: center;
}

.check-cell input {
  width: auto;
}

.check-cell-muted input {
  accent-color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.55;
}

.field-display-row {
  align-items: center;
  display: flex;
}

.field-order-controls {
  display: flex;
  gap: 2px;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 120ms ease;
}

.field-order-controls .icon-button {
  background: transparent;
  color: #7c8a90;
  width: 30px;
}

.field-order-controls:hover,
.field-order-controls:focus-within {
  opacity: 1;
}

.field-order-controls .icon-button:hover,
.field-order-controls .icon-button:focus-visible {
  background: #eef3f4;
  color: var(--text);
}

.field-order-controls svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.error {
  color: var(--danger);
  font-weight: 700;
}

.required-marker {
  color: var(--danger);
  font-weight: 800;
}

.success {
  color: var(--accent-dark);
  font-weight: 700;
}

@media (max-width: 760px) {
  .grid.two,
  .app-shell,
  .board-filters,
  .client-assignment-form,
  .page-head,
  .search-panel {
    grid-template-columns: 1fr;
  }

  .feature-subsettings {
    margin-left: 0;
  }

  .time-tracking-mode-options {
    grid-template-columns: 1fr;
  }

  .page:has(.app-shell) {
    padding: 0;
  }

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    min-height: auto;
    position: static;
    padding: 8px 12px 10px;
  }

  .sidebar-toggle {
    display: none;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle {
    left: 16px;
  }

  .app-shell.sidebar-collapsed .side-nav,
  .side-nav {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .sidebar-client-switcher,
  .sidebar-search {
    border: 0;
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
  }

  .side-nav:not(:has(.sidebar-client-switcher)) .sidebar-search {
    grid-column: 1 / -1;
  }

  .sidebar-client-switcher label {
    font-size: 10px;
    margin: 0;
  }

  .sidebar-client-switcher select,
  .sidebar-search input {
    min-height: 44px;
  }

  .side-nav a[data-workspace-link] {
    align-items: center;
    display: flex;
    font-size: 14px;
    justify-content: center;
    min-height: 44px;
    padding: 8px 4px;
    text-align: center;
  }

  .side-nav .side-label,
  .side-nav [data-sidebar-secondary-link] {
    display: none;
  }

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

  .client-admin-nav .sidebar-client-switcher {
    grid-column: 1 / -1;
  }

  .desktop-admin-nav-label {
    display: none;
  }

  .mobile-admin-nav-label {
    display: inline;
  }

  .content-area {
    overflow: visible;
    padding: 16px;
  }

  .mobile-workspace-menu {
    display: block;
  }

  .mobile-workspace-menu summary {
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    min-height: 40px;
    padding: 11px 8px 7px;
  }

  .mobile-workspace-menu nav {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px 0 8px;
  }

  .mobile-workspace-menu strong {
    color: var(--muted);
    font-size: 11px;
    grid-column: 1 / -1;
    padding: 8px 8px 2px;
    text-transform: uppercase;
  }

  .mobile-workspace-menu a {
    border-radius: 6px;
    color: var(--text);
    min-height: 44px;
    padding: 11px 8px;
  }

  .mobile-workspace-menu a.active {
    background: #e8f2f4;
  }

  .page-head {
    gap: 12px;
  }

  .page-head h1 {
    font-size: 26px;
    margin-bottom: 4px;
  }

  .page-head p {
    margin-bottom: 0;
  }

  .page-head .button,
  .search-panel button,
  .board-filter-toggle,
  .quickfilter-link,
  .kanban-column-actions .icon-button,
  .shelf-close,
  .mobile-topbar-menu summary {
    min-height: 44px;
    min-width: 44px;
  }

  .search-panel {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
  }

  .search-panel label {
    flex: 1 0 100%;
  }

  .search-panel > button[type="submit"] {
    flex: 1 1 auto;
  }

  .search-panel .search-action-button {
    flex: 0 0 44px;
    justify-self: start;
  }

  .task-results-panel {
    padding: 14px;
  }

  .mobile-kanban-tabs {
    background: var(--bg);
    display: flex;
    gap: 6px;
    margin: 0 -4px 12px;
    overflow-x: auto;
    padding: 4px;
    position: sticky;
    scroll-snap-type: x proximity;
    top: var(--topbar-height);
    z-index: 10;
  }

  .mobile-kanban-tabs button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    justify-content: center;
    min-height: 46px;
    padding: 8px 10px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .mobile-kanban-tabs button[aria-selected="true"] {
    background: var(--panel);
    border-color: var(--accent);
    color: var(--accent-dark);
  }

  .mobile-kanban-tabs strong {
    background: #e8f2f4;
    border-radius: 999px;
    font-size: 12px;
    min-width: 22px;
    padding: 3px 6px;
  }

  .kanban-board {
    display: block;
    min-height: 0;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .kanban-column {
    display: none;
    max-height: none;
    min-height: 320px;
  }

  .kanban-column.mobile-active {
    display: grid;
  }

  .kanban-stack {
    overflow-y: visible;
  }

  .task-card {
    cursor: pointer;
    min-height: 60px;
    padding-right: 56px;
  }

  .task-card-move {
    display: inline-flex;
    height: 44px;
    opacity: 1;
    position: absolute;
    right: 6px;
    top: 6px;
    width: 44px;
    z-index: 2;
  }

  .board-controls.has-quickfilters {
    align-items: center;
    flex-wrap: nowrap;
  }

  .quickfilter-bar {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
  }

  .quickfilter-title {
    display: none;
  }

  .quickfilter-links {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  .quickfilter-link {
    white-space: nowrap;
  }

  .table-wrap {
    overflow: visible;
  }

  .task-results-table,
  .task-results-table tbody {
    display: grid;
    gap: 10px;
    min-width: 0;
    width: 100%;
  }

  .task-results-table thead {
    display: none;
  }

  .task-results-table tr {
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    overflow: hidden;
    padding: 8px 12px;
  }

  .task-results-table td {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(88px, 0.4fr) minmax(0, 1fr);
    padding: 10px 0;
  }

  .task-results-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .task-results-table td:last-child {
    border-bottom: 0;
  }

  .task-results-table td:empty {
    display: none;
  }

  .task-results-table .task-title-cell {
    display: block;
    font-size: 16px;
    font-weight: 800;
  }

  .task-results-table .task-title-cell::before {
    content: none;
  }

  .task-shelf {
    inset: 0;
    z-index: 60;
  }

  .task-shelf-panel {
    max-width: 100vw;
    width: 100vw;
  }

  [data-task-shelf-content] {
    padding: 18px 20px 28px;
  }

  .shelf-details-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .shelf-field--row {
    column-gap: 12px;
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .shelf-field--row.stack {
    column-gap: 12px;
  }

  .shelf-field--wide {
    grid-column: auto;
  }

  .shelf-field--attachments .shelf-inline-form {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .quickfilter-row {
    grid-template-columns: 1fr;
  }

  .quickfilter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quickfilter-fields label:first-child {
    grid-column: 1 / -1;
  }

  .quickfilter-actions {
    justify-content: flex-start;
  }

  .page-head {
    align-items: stretch;
    display: grid;
  }

  .dashboard-grid.columns-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-edit-actions {
    justify-content: flex-end;
  }

  .dashboard-layout-control {
    display: none;
  }

  .dashboard-action-divider {
    margin-left: auto;
  }

  .dashboard-widget-actions {
    opacity: 1;
  }

  .dashboard-link-actions {
    opacity: 1;
  }

  .board-column-actions,
  .custom-field-actions,
  .quickfilter-actions,
  .field-order-controls {
    opacity: 1;
  }

  .dashboard-widget-drag,
  .dashboard-widget-edit {
    min-height: 44px;
    min-width: 44px;
  }

  .user-access-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .user-row-actions {
    justify-content: stretch;
  }

  .user-row-actions form {
    width: 100%;
  }

  .user-row-actions button {
    width: 100%;
  }

  .user-row-actions .button {
    width: 100%;
  }

  .topbar {
    align-items: center;
    display: flex;
    min-height: var(--topbar-height);
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .topbar .desktop-topbar-nav {
    display: none;
  }

  .mobile-topbar-menu {
    display: block;
  }

  .impersonation-banner {
    align-items: stretch;
    display: grid;
    justify-content: stretch;
  }

  .modal-card {
    top: 48%;
    width: calc(100vw - 32px);
  }

  .modal-actions {
    display: grid;
  }

  .toast-region {
    bottom: 16px;
    right: 16px;
    width: calc(100vw - 32px);
  }

  .field-display-grid {
    gap: 6px;
    grid-template-columns: repeat(3, minmax(48px, 1fr)) 94px;
    min-width: 0;
  }

  .field-display-grid > span:first-child {
    display: none;
  }

  .field-display-grid > strong {
    display: none;
  }

  .field-display-row {
    background: #f8fbfb;
    border-radius: 6px 6px 0 0;
    grid-column: 1 / -1;
    margin-top: 8px;
    min-height: 44px;
    padding: 10px 12px;
  }

  .check-cell,
  .field-order-controls {
    background: #f8fbfb;
    min-height: 68px;
  }

  .check-cell {
    border-radius: 0 0 6px 6px;
    flex-direction: column;
    gap: 8px;
  }

  .field-order-controls {
    border-radius: 0 0 6px 6px;
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(2, 44px);
  }

  .check-cell::before,
  .field-order-controls::before {
    color: var(--muted);
    content: attr(data-column-label);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .field-order-controls::before {
    grid-column: 1 / -1;
    text-align: center;
  }

  .field-order-controls .icon-button {
    height: 44px;
    width: 44px;
  }

  .field-group,
  .panel.stack {
    min-width: 0;
  }

  .board-column-editor-head,
  .board-column-row {
    grid-template-columns: 1fr;
  }

  .board-column-editor-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .board-column-actions {
    justify-content: flex-end;
  }

  .board-column-actions .icon-button,
  .custom-field-actions .icon-button,
  .quickfilter-actions .icon-button {
    height: 44px;
    width: 44px;
  }

  .panel.stack > button[type="submit"] {
    bottom: 12px;
    box-shadow: 0 8px 24px rgba(24, 32, 37, 0.2);
    min-height: 48px;
    position: sticky;
    width: 100%;
    z-index: 8;
  }
}
