:root {
  --bg: #eef1ef;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-soft: rgba(238, 247, 245, .62);
  --surface-tint: rgba(249, 250, 249, .86);
  --text: #121a19;
  --muted: #697370;
  --line: rgba(93, 111, 106, .18);
  --line-soft: rgba(93, 111, 106, .11);
  --accent: #0f766e;
  --accent-dark: #0b5d57;
  --danger: #be123c;
  --warning: #b45309;
  --focus: #0ea5a0;
  --shadow: 0 22px 70px rgba(18, 26, 25, .12);
  --shadow-soft: 0 10px 32px rgba(18, 26, 25, .07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .68), rgba(255, 255, 255, 0) 280px),
    var(--bg);
  color: var(--text);
  font-family: "Archivo", sans-serif;
  font-size: 15px;
}

body.theme-dark {
  --bg: #101514;
  --surface: rgba(28, 36, 34, .82);
  --surface-solid: #1b2422;
  --surface-soft: rgba(25, 48, 44, .5);
  --surface-tint: rgba(23, 31, 29, .9);
  --text: #edf5f2;
  --muted: #a9b8b3;
  --line: rgba(201, 217, 211, .18);
  --line-soft: rgba(201, 217, 211, .1);
  --accent: #23a99b;
  --accent-dark: #178d82;
  --danger: #ff6674;
  --warning: #f0b84a;
  --focus: #2dd4bf;
  --shadow: 0 22px 70px rgba(0, 0, 0, .38);
  --shadow-soft: 0 10px 32px rgba(0, 0, 0, .22);
}

body.theme-dark {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 280px),
    var(--bg);
}

body.is-authenticated #loginView {
  display: none !important;
}

body.is-authenticated #appView {
  display: block !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

body.theme-dark button {
  background: rgba(30, 40, 38, .78);
}

body.theme-dark .primary {
  background: #0F766E;
  color: #fff;
}

body.theme-dark .primary:hover {
  background: #0b5d57;
}

button:hover {
  background: rgba(255, 255, 255, .95);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .28), 0 6px 18px rgba(18, 26, 25, .06);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(14, 165, 160, .25);
  outline-offset: 1px;
}

.primary {
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  box-shadow: 0 8px 22px rgba(15, 118, 110, .18);
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary,
.ghost {
  padding: 0 14px;
}

.ghost {
  background: transparent;
  box-shadow: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

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

.login-panel h1,
.app-header h1,
.drawer-panel h2,
.charts-grid h2,
.admin-grid h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel label,
.drawer-panel label,
.toolbar label,
.inline-form label,
.narrow-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .7);
  color: var(--text);
  padding: 8px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: rgba(20, 27, 26, .76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 36px;
  min-height: 32px;
  transform: translateY(-50%);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  padding: 0;
}

.password-toggle:hover {
  background: rgba(255, 255, 255, .7);
  color: var(--text);
  box-shadow: none;
}

body.theme-dark .password-toggle:hover {
  background: rgba(255, 255, 255, .08);
}

.text-link {
  min-height: auto;
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  padding: 4px 0;
  font-weight: 700;
}

.text-link:hover {
  background: transparent;
  color: var(--accent-dark);
  box-shadow: none;
}

.auth-help {
  margin: 10px 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

textarea {
  resize: vertical;
}

.error-text {
  min-height: 20px;
  color: var(--danger);
}

.success-text {
  min-height: 20px;
  color: var(--accent);
}

.app-shell {
  min-height: 100vh;
  padding: 18px 24px 30px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 13px;
  box-shadow: none;
}

.tabs button.active {
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-soft), var(--shadow-soft);
}

.subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.subtabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.subtabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-soft), var(--shadow-soft);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.admin-subpanel {
  display: none;
}

.admin-subpanel.active {
  display: block;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .46);
  backdrop-filter: blur(14px);
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .54), 0 10px 28px rgba(18, 26, 25, .04);
}

body.theme-dark .toolbar,
body.theme-dark .task-table,
body.theme-dark .tabulator .tabulator-header,
body.theme-dark .tabulator .tabulator-footer,
body.theme-dark .stats-summary div,
body.theme-dark .charts-grid section,
body.theme-dark .narrow-panel,
body.theme-dark .admin-grid section,
body.theme-dark .login-panel,
body.theme-dark .drawer-panel,
body.theme-dark .modal-panel {
  background: var(--surface);
}

.search-field {
  flex: 1 1 320px;
}

.task-table {
  min-height: 620px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .66);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72), var(--shadow-soft);
}

.tabulator {
  border: 0;
  background: transparent;
  font-size: 14px;
}

.tabulator .tabulator-header {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(244, 247, 246, .86);
  color: var(--muted);
  font-weight: 700;
}

.tabulator .tabulator-header .tabulator-col {
  border-right: 0;
  background: transparent;
}

.tabulator .tabulator-header .tabulator-col-content {
  padding: 9px 10px;
}

.tabulator .tabulator-row {
  min-height: 44px;
  border-bottom: 0;
  background: rgba(255, 255, 255, .54);
}

body.theme-dark .tabulator .tabulator-row {
  background: rgba(12, 18, 17, .92);
  color: #f5fbf9;
}

body.theme-dark .tabulator .tabulator-row.tabulator-row-even {
  background: rgba(20, 29, 27, .96);
  color: #f5fbf9;
}

body.theme-dark .tabulator .tabulator-row:hover {
  background: rgba(25, 60, 55, .88);
}

body.theme-dark .tabulator .tabulator-cell,
body.theme-dark .tabulator .tabulator-header .tabulator-col {
  color: #f5fbf9;
}

body.theme-dark .tabulator .tabulator-header {
  color: #dce8e4;
}

body.theme-dark .tabulator .tabulator-footer .tabulator-page {
  color: #f5fbf9;
  background: rgba(22, 31, 29, .92);
  box-shadow: inset 0 0 0 1px rgba(220, 232, 228, .18);
}

body.theme-dark .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {
  background: rgba(35, 169, 155, .18);
  color: #ffffff;
}

body.theme-dark .tabulator .tabulator-footer .tabulator-page.disabled {
  color: rgba(245, 251, 249, .42);
}

.tabulator .tabulator-row.tabulator-row-even {
  background: rgba(247, 249, 248, .74);
}

.tabulator .tabulator-row:hover {
  background: rgba(237, 247, 245, .88);
}

.tabulator .tabulator-cell {
  border-right: 0;
  padding: 9px 10px;
  line-height: 26px;
  vertical-align: middle;
}

.tabulator .tabulator-col[tabulator-field="actions"],
.tabulator .tabulator-cell[tabulator-field="actions"] {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: -12px 0 18px -18px rgba(15, 23, 42, .45);
}

body.theme-dark .tabulator .tabulator-col[tabulator-field="actions"],
body.theme-dark .tabulator .tabulator-cell[tabulator-field="actions"] {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: -12px 0 18px -18px rgba(0, 0, 0, .7);
}

.tabulator .tabulator-cell.tabulator-editing {
  line-height: normal;
}

.tabulator .tabulator-footer {
  border-top: 1px solid var(--line-soft);
  background: rgba(249, 250, 249, .78);
}

.tabulator .tabulator-footer .tabulator-page {
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
}

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

.badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  background: rgba(237, 247, 245, .82);
  color: #0f544f;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge[style*="--tag-color"] {
  border-left: 4px solid var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 18%, rgba(255, 255, 255, .84));
  color: #182422;
}

body.theme-dark .badge[style*="--tag-color"],
body.theme-dark .badge.support[style*="--tag-color"],
body.theme-dark .badge.status[style*="--tag-color"],
body.theme-dark .badge[class*="urgent-"][style*="--tag-color"] {
  background: color-mix(in srgb, var(--tag-color) 32%, rgba(21, 28, 27, .88));
  color: #f2faf7;
}

body.theme-dark .badge.support,
body.theme-dark .badge.status {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.badge.support {
  background: #eef4ff;
  color: #1d4f91;
}

.badge.support[style*="--tag-color"] {
  background: color-mix(in srgb, var(--tag-color) 18%, rgba(255, 255, 255, .84));
  color: #182422;
}

.badge.status {
  background: #f4f6f5;
  color: #495553;
}

.badge.urgent-1 {
  background: #fff7ed;
  color: var(--warning);
}

.badge.urgent-2,
.badge.urgent-3 {
  background: #fff1f2;
  color: var(--danger);
}

.badge.status[style*="--tag-color"],
.badge[class*="urgent-"][style*="--tag-color"] {
  border-left: 4px solid var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 30%, rgba(255, 255, 255, .82));
  color: #182422;
}

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

.row-actions button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.row-actions button:hover {
  background: rgba(255, 255, 255, .84);
}

.row-actions .fa-solid,
.attachment-list .fa-solid {
  font-size: 13px;
}

.row-actions .fa-solid {
  font-size: 20px;
}

.row-actions button[data-action="delete"] {
  color: #FF4758;
}

.drawer,
.modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(18, 26, 25, .22);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.drawer.open,
.modal.open {
  display: block;
}

.drawer-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(860px, 100%);
  overflow: auto;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  padding: 22px;
}

.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide,
.rich-label {
  grid-column: 1 / -1;
}

.rich-label {
  margin-top: 14px;
}

.tox.tox-tinymce {
  min-height: 520px;
}

.is-hidden-field {
  display: none !important;
}

.tag-field-label {
  min-width: 0;
}

.tag-field {
  position: relative;
  display: flex;
  min-height: 42px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .64);
  padding: 5px 8px;
}

.tabulator-row .tabulator-cell.tabulator-editing {
  border: 0 !important;
}

.tabulator .cell-tag-editor {
  border-color: rgba(93, 111, 106, .95);
  background: rgba(255, 255, 255, .95);
}

.tag-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(14, 165, 160, .16);
}

.tag-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border-radius: 6px;
  border-left: 4px solid var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 20%, rgba(255, 255, 255, .86));
  color: #172321;
  padding: 3px 4px 3px 7px;
  font-size: 13px;
  font-weight: 700;
}

.tag-chip button {
  width: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, .72);
  padding: 0;
  line-height: 1;
}

.tag-chip.single {
  padding-right: 8px;
}

.tag-field input[data-tag-input] {
  min-width: 140px;
  flex: 1 1 140px;
  width: auto;
  min-height: 30px;
  border: 0;
  padding: 3px 2px;
}

.tag-field input[data-tag-input]:focus-visible {
  outline: 0;
}

.tag-field input[data-tag-input]:disabled {
  background: transparent;
  color: var(--muted);
}

.single-tag-field input[data-tag-input] {
  cursor: pointer;
}

.tag-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  max-height: min(340px, 55vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 5px;
}

body.theme-dark .tag-field,
body.theme-dark .tag-menu,
body.theme-dark .tag-menu-portal {
  background: rgba(20, 27, 26, .96);
}

body.theme-dark .tag-menu button:hover {
  background: rgba(35, 169, 155, .16);
}

body.theme-dark .tag-chip {
  background: color-mix(in srgb, var(--tag-color) 30%, rgba(21, 28, 27, .88));
  color: #f2faf7;
}

.tag-field.open .tag-menu {
  display: grid;
  gap: 2px;
}

.tag-menu button {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  text-align: left;
}

.tag-menu button:hover {
  background: #eef7f5;
}

.tag-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--tag-color);
}

.tabulator .tabulator-row:has(.cell-tag-editor),
.tabulator .tabulator-cell:has(.cell-tag-editor) {
  overflow: visible;
  z-index: 8;
}

.cell-tag-editor {
  min-width: min(280px, 70vw);
  width: 100%;
}

.cell-tag-editor .tag-menu {
  min-width: 220px;
}

.tag-menu-portal {
  position: fixed;
  right: auto;
  z-index: 10000;
  display: none;
  gap: 2px;
  overflow: auto;
}

.tag-menu-portal.open {
  display: grid;
}

.tag-empty {
  color: var(--muted);
  padding: 8px;
  font-size: 13px;
}

.duration-editor {
  position: fixed;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 10px;
}

body.theme-dark .duration-editor {
  background: rgba(23, 31, 29, .98);
}

.duration-editor input {
  min-height: 34px;
  padding: 6px 8px;
}

.duration-editor label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.duration-cell-editor {
  width: 100%;
  min-height: 28px;
}

.date-cell-editor {
  min-height: 34px;
  border: 0;
  background: rgba(255, 255, 255, .95);
  box-shadow: none;
  padding: 4px 6px;
}

.duration-presets {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.duration-presets button,
.duration-actions button {
  min-height: 28px;
  border-radius: 5px;
  padding: 0 5px;
  font-size: 12px;
}

.duration-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.duration-actions [data-duration-ok] {
  background: var(--accent);
  color: #fff;
}

.drawer-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px -22px -22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px);
  padding: 14px 22px;
}

.modal-panel {
  position: relative;
  width: min(900px, calc(100% - 28px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  margin: 28px auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  padding: 26px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 18px;
}

.detail-description {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 0;
  line-height: 1.55;
}

.attachment-list,
.activity-list,
.option-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.attachment-list a:visited {
  color: #6d28d9;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
}

.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .12);
  color: var(--text);
  padding: 5px 7px 5px 10px;
  font-size: 13px;
  font-weight: 600;
}

.active-filter button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-height: 24px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.stats-summary div,
.charts-grid section,
.narrow-panel,
.admin-grid section {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .68);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .68), var(--shadow-soft);
}

.stats-summary div {
  display: grid;
  gap: 2px;
  padding: 14px;
}

.stats-summary strong {
  font-size: 26px;
}

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

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.charts-grid section,
.narrow-panel,
.admin-grid section {
  padding: 16px;
}

.charts-grid .chart-wide {
  grid-column: 1 / -1;
}

.organism-share-chart {
  position: relative;
  min-height: 300px;
}

.organism-share-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.organism-share-value {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .56);
  padding: 7px 9px;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: 12px;
}

body.theme-dark .organism-share-value {
  background: rgba(17, 24, 23, .58);
}

.organism-share-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-weight: 700;
}

.organism-share-name i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--chart-color);
}

.organism-share-value small {
  color: var(--muted);
}

.charts-grid h2,
.admin-grid h2,
.narrow-panel h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.chart-value-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chart-value-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border-radius: 6px;
  background: rgba(255, 255, 255, .56);
  color: var(--text);
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.3;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

body.theme-dark .chart-value-list span {
  background: rgba(17, 24, 23, .58);
}

.chart-value-list i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--chart-color);
}

.chart-value-list [role="button"] {
  cursor: pointer;
}

.chart-value-list [role="button"]:hover {
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .28), 0 6px 18px rgba(18, 26, 25, .06);
}

.narrow-panel {
  max-width: 720px;
}

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

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

.wide-admin {
  grid-column: 1 / -1;
}

.inline-form {
  display: grid;
  gap: 10px;
}

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

.check input {
  width: auto;
  min-height: auto;
}

.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .56);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  padding: 8px;
}

body.theme-dark .option-item {
  background: rgba(17, 24, 23, .58);
}

.button-like {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  padding: 0 14px;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.button-like:hover {
  background: rgba(255, 255, 255, .72);
}

body.theme-dark .button-like:hover {
  background: rgba(255, 255, 255, .08);
}

.option-item.notification-log {
  align-items: flex-start;
  border-left: 4px solid var(--muted);
}

.option-item.notification-log span {
  display: grid;
  gap: 3px;
}

.option-item.notification-log small {
  color: var(--muted);
  font-size: 12px;
}

.option-item.notification-log.sent {
  border-left-color: var(--accent);
}

.option-item.notification-log.failed {
  border-left-color: #FF4758;
}

.option-item.notification-log.skipped {
  border-left-color: var(--warning);
}

.retrigger-events,
.retrigger-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.retrigger-events label,
.retrigger-task {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.retrigger-events input,
.retrigger-task input {
  width: auto;
  min-height: auto;
}

.retrigger-toolbar {
  justify-content: space-between;
}

.retrigger-list {
  display: grid;
  max-height: 360px;
  overflow: auto;
  gap: 6px;
  padding-right: 4px;
}

.retrigger-task {
  display: grid !important;
  grid-template-columns: auto 72px 82px minmax(0, 1fr);
  border-radius: 6px;
  background: rgba(255, 255, 255, .52);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  padding: 8px;
}

body.theme-dark .retrigger-task {
  background: rgba(17, 24, 23, .58);
}

.retrigger-task strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.retrigger-task small {
  grid-column: 4;
  color: var(--muted);
}

.muted-note {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: none;
  max-width: min(440px, calc(100vw - 36px));
  border-radius: 8px;
  background: #15201f;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.toast button {
  margin-left: 10px;
  min-height: 32px;
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
  background: transparent;
}

pre {
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 14px;
  }

  .app-header,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
  }

  .task-table {
    min-height: 520px;
  }

  .charts-grid,
  .admin-grid,
  .admin-grid.two,
  .stats-summary {
    grid-template-columns: 1fr;
  }

  .organism-share-values {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .organism-share-value {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .drawer-panel,
  .modal-panel {
    inset: 0;
    width: 100%;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .user-box {
    align-items: stretch;
    flex-direction: column;
  }
}
