:root {
  --blue: #236eb0;
  --blue-press: #195785;
  --blue-80: #4a8cc1;
  --blue-40: #a9cce8;
  --blue-20: #dcecf9;
  --navy: #3d4057;
  --ink: #16252a;
  --muted: #3e525c;
  --line: #d5e2ec;
  --wash: #f4f8fb;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(22, 37, 42, 0.06), 0 12px 32px rgba(35, 110, 176, 0.1);
  --font: Poppins, Arial, sans-serif;
  --nav-width: 232px;
  --detail-width: 400px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--card);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--blue-20);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

a {
  color: var(--blue-press);
}

/* Sign in */

.page-sign-in {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--blue-20) 0%, var(--wash) 38%, #fff 100%);
}

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(430px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px 24px;
}

.auth-logo {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto 28px;
}

.auth-card h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 6px 0 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.auth-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fde8e8;
  color: #6d1c1c;
  font-size: 13px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  caret-color: var(--blue);
}

.field input::placeholder {
  color: var(--blue-80);
}

.field input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
  border-color: var(--blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
  padding: 11px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  background: var(--blue-press);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 0;
  font-size: 13px;
}

.auth-links a {
  color: var(--blue-press);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 3px;
}

.auth-links a:hover {
  text-decoration: underline;
}

.site-footer {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

/* App shell */

.page-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--wash);
}

.app-header {
  height: var(--header-height);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px 0 18px;
  background: var(--card);
  border-bottom: 3px solid var(--blue);
  box-shadow: 0 1px 0 rgba(22, 37, 42, 0.04);
}

.app-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-brand img {
  display: block;
  height: 34px;
  width: auto;
}

.app-header__end {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.signed-in-as {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.btn--quiet {
  width: auto;
  margin: 0;
  padding: 7px 12px;
  background: transparent;
  color: var(--blue-press);
  border: 1px solid var(--blue-40);
}

.btn--quiet:hover {
  background: var(--blue-20);
}

.app-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.app-nav {
  width: var(--nav-width);
  flex: 0 0 var(--nav-width);
  overflow: auto;
  padding: 14px 10px;
  background: var(--card);
  border-right: 1px solid var(--line);
}

.nav-group + .nav-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link:hover {
  background: var(--blue-20);
}

.nav-link[aria-current="page"] {
  background: var(--blue);
  color: #fff;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--wash);
}

.section-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 22px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.section-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-head-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.head-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.list-toolbar-stick {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 4;
  box-sizing: border-box;
  width: 100%;
  padding: 22px 22px 12px;
  background: var(--wash);
}

.section-pane:has(.list-toolbar-stick) {
  padding-top: 0;
  --table-head-top: 68px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  margin: 0;
  padding: 3px;
  border-radius: 12px;
  background: #e8edf1;
}

.list-toolbar button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

.list-toolbar button:hover {
  background: #fff;
}

.list-toolbar button:disabled {
  color: rgba(61, 64, 87, 0.35);
  cursor: default;
}

.list-toolbar button:disabled:hover {
  background: transparent;
}

.list-toolbar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.list-toolbar svg .front {
  fill: #e8edf1;
}

.list-toolbar button:hover svg .front {
  fill: #fff;
}

.list-toolbar button:disabled:hover svg .front {
  fill: #e8edf1;
}

.section-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.section-pane {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 22px;
}

.section-pane[hidden] {
  display: none;
}

.section-pane:has(.table-scroll) {
  padding-left: 0;
  padding-right: 0;
}

.section-pane:has(.table-scroll) > .empty {
  margin-left: 22px;
  margin-right: 22px;
}

.table-scroll {
  display: inline-block;
  box-sizing: content-box;
  width: max-content;
  min-width: calc(100% - 44px);
  padding: 0 22px 2px;
  vertical-align: top;
}

.table-edges {
  position: sticky;
  top: 22px;
  z-index: 6;
  height: 0;
  pointer-events: none;
}

.section-pane:has(.list-toolbar-stick) .table-edges {
  top: var(--table-head-top);
}

.table-edges span {
  position: absolute;
  top: 0;
  width: 1px;
  background: var(--line);
}

.table-edges span:last-child {
  right: 0;
}

.empty {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
}

.record-count {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.dash-module {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  max-height: 280px;
  padding: 15px 16px 12px 18px;
  border: 1px solid rgba(35, 110, 176, 0.22);
  border-radius: 14px;
  background: var(--card);
  box-shadow:
    0 1px 1px rgba(22, 37, 42, 0.07),
    0 8px 18px rgba(22, 37, 42, 0.08);
  overflow: hidden;
}

.dash-module::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1px;
  width: 3px;
  background: linear-gradient(#236eb0, rgba(35, 110, 176, 0.45));
}

.dash-module--timeline {
  grid-column: 1 / -1;
  max-height: none;
}

.dash-module h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.dash-module-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(35, 110, 176, 0.14);
  color: var(--blue);
}

.dash-module-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-module-icon--quiet {
  background: transparent;
  color: #8aa0ab;
}

.dash-module-body {
  min-height: 0;
  overflow: auto;
}

.dash-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.dash-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dash-row:hover {
  background: var(--wash);
}

.dash-title {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  font-size: 14px;
  line-height: 1.3;
}

.dash-title > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-title.is-done > span:last-child {
  text-decoration: line-through;
}

.dash-check {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.dash-check svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-check.is-done {
  color: #1f8a4c;
}

.dash-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.tl-weekend {
  background: rgba(22, 37, 42, 0.045);
}

.dash-block + .dash-block {
  margin-top: 28px;
}

.dash-block h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.record-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 0;
  border-radius: 10px;
  font-size: 14px;
}

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

.record-table th:first-child {
  border-left: 1px solid var(--line);
}

.record-table th:last-child {
  border-right: 1px solid var(--line);
}

.table-scroll .record-table td:first-child,
.table-scroll .record-table td:last-child {
  border-left: 0;
  border-right: 0;
}

.record-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  border-top: 1px solid var(--line);
  background: var(--wash);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.section-pane:has(.list-toolbar-stick) .record-table th {
  top: var(--table-head-top);
}

.record-table tr:first-child th:first-child {
  border-top-left-radius: 9px;
}

.record-table tr:first-child th:last-child {
  border-top-right-radius: 9px;
}

.record-table tbody tr:last-child td {
  border-bottom: 1px solid var(--line);
}

.record-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 9px;
}

.record-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 9px;
}

.record-table tr {
  cursor: pointer;
}

.record-table tbody tr:hover {
  background: var(--blue-20);
}

.record-table tr[aria-selected="true"] {
  background: var(--blue);
  color: #fff;
}

.record-table tr[aria-selected="true"]:hover {
  background: var(--blue-press);
}

.record-table.anchored {
  width: 100%;
}

.record-table.anchored.project-table {
  min-width: 1040px;
}

.record-table.anchored th,
.record-table.anchored td {
  white-space: nowrap;
}

.record-table td.clip {
  max-width: 280px;
}

.record-table td.clip .clip-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-table td.clip .task-title-line {
  max-width: 280px;
}

.record-table td.clip .task-title-line .clip-text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

.dash-title .clip-text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-tip {
  position: fixed;
  z-index: 30;
  max-width: min(360px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(22, 37, 42, 0.18);
}

.record-table.project-table th:first-child,
.record-table.project-table td:first-child {
  width: 36px;
  padding-right: 4px;
}

.section-head .task-search {
  width: 220px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.record-table.task-table th:first-child,
.record-table.task-table td:first-child {
  width: 72px;
}

.task-title-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  vertical-align: bottom;
}

.task-twist,
.task-spacer {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.task-twist {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.task-twist svg {
  display: block;
  width: 12px;
  height: 12px;
  margin: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.task-twist.is-open svg {
  transform: rotate(90deg);
}

.task-title.is-done,
.task-description .is-done {
  text-decoration: line-through;
}

.task-check {
  display: inline-flex;
  color: var(--muted);
}

.task-check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-check.is-done {
  color: #1f8a4c;
}

.task-empty {
  color: var(--muted);
}

.record-table tr[aria-selected="true"] .task-check,
.record-table tr[aria-selected="true"] .task-empty {
  color: #fff;
}

.task-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-person + .task-person {
  margin-top: 8px;
}

.task-update,
.task-update-empty {
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid var(--blue);
  border-radius: 8px;
}

.task-update .card-value + .card-value {
  margin-top: 6px;
}

.task-update-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.case-status.is-open {
  color: #c62828;
}

.case-status.is-closed {
  color: #1f8a4c;
}

.record-table tr.is-closed td {
  color: var(--muted);
}

.record-table tr.is-closed td.case-status {
  color: #1f8a4c;
}

.record-table tr[aria-selected="true"] td.case-status,
.record-table tr[aria-selected="true"].is-closed td {
  color: #fff;
}

.case-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--wash);
  font-size: 13px;
}

.app-frame.detail-open .section-body {
  margin-right: calc(var(--detail-width) + 24px);
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.sort-btn::after {
  content: "";
  width: 0.7em;
}

th[aria-sort="ascending"] .sort-btn::after {
  content: "↑";
}

th[aria-sort="descending"] .sort-btn::after {
  content: "↓";
}

.project-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: transparent;
  vertical-align: middle;
}

.detail-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.detail-row dt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.detail-row dd {
  margin: 0;
  white-space: pre-wrap;
}

a.detail-explorer {
  gap: 8px;
  margin-top: 18px;
  text-decoration: none;
}

a.detail-explorer svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-detail {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  bottom: 0;
  width: calc(var(--detail-width) + 24px);
  display: flex;
  padding: 16px 16px 16px 8px;
  background: transparent;
}

.detail-card {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(22, 37, 42, 0.06),
    0 16px 40px rgba(22, 37, 42, 0.14);
  overflow: hidden;
}

.detail-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 12px 6px 16px;
}

.detail-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e6ebef;
  color: #3d4c55;
}

.detail-mark svg,
.detail-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-titles {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.detail-titles h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.detail-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-close {
  width: 28px;
  height: 28px;
  margin-top: -2px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5c6d76;
  cursor: pointer;
}

.detail-close:hover {
  background: var(--wash);
  color: var(--ink);
}

.detail-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 18px 18px;
}

.project-card,
.asset-card,
.task-card,
.case-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.card-row,
.loc-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.loc-row {
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.loc-row.is-selected {
  background: var(--blue-20);
}

.card-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--muted);
}

.card-ico svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-value,
.card-label,
.card-note,
.tl-notes {
  display: block;
  margin: 0;
}

.card-row > div,
.loc-row > :last-child {
  flex: 1;
  min-width: 0;
}

.card-value {
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card-label,
.card-note,
.tl-notes {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-note {
  font-size: 13px;
}

.tl-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.tl-sheet {
  --tl-track: 22px;
  position: relative;
  width: calc(var(--days) * 22px);
}

.tl-sheet--fill {
  --tl-track: minmax(22px, 1fr);
  width: max(100%, calc(var(--days) * 22px));
}

.tl-shades,
.tl-months,
.tl-dates,
.tl-dows,
.tl-entry {
  display: grid;
  grid-template-columns: repeat(var(--days), var(--tl-track, 22px));
  width: 100%;
}

.tl-shades {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.tl-today {
  background: rgba(52, 168, 83, 0.16);
}

.tl-months,
.tl-dates,
.tl-dows,
.tl-entry,
.tl-rule {
  position: relative;
  z-index: 1;
}

.tl-months div,
.tl-dates span,
.tl-dows span {
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}

.tl-months div {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.tl-rule {
  height: 1px;
  margin: 4px 0 6px;
  background: rgba(22, 37, 42, 0.15);
}

.tl-entry {
  min-height: 26px;
  margin-bottom: 4px;
}

.tl-span {
  position: relative;
  height: 26px;
  min-width: 0;
}

.tl-label {
  position: absolute;
  left: 0;
  top: 2px;
  height: 22px;
  width: max-content;
  min-width: 100%;
  max-width: none;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--bar, #4a8cc1);
  color: var(--ink, #fff);
  font-size: 11px;
  font-weight: 600;
  line-height: 22px;
  text-align: left;
  white-space: nowrap;
  box-sizing: border-box;
}

.tl-label.is-button {
  cursor: pointer;
}

.tl-label.is-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.tl-notes {
  grid-column: 1 / -1;
  padding: 2px 6px 2px;
  white-space: pre-wrap;
}

.asset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.asset-split {
  height: 1px;
  margin: 12px 0;
  border: 0;
  background: rgba(22, 37, 42, 0.12);
}

.mini-table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}

.mini-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  background: var(--wash);
}

.mini-table td {
  border-top: 1px solid var(--line);
}

.loc-list {
  max-height: 160px;
  overflow: auto;
}

.loc-map {
  height: 200px;
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--wash);
}

.loc-map .card-note {
  padding: 12px;
}

.app-nav,
.section-pane,
.detail-body {
  scrollbar-color: var(--blue-40) transparent;
  scrollbar-width: thin;
}

@media (max-width: 960px) {
  .app-detail {
    position: fixed;
    z-index: 6;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: min(100%, 440px);
    flex: none;
    padding: 12px;
    background: rgba(22, 37, 42, 0.28);
  }

  .app-frame.detail-open .section-body {
    margin-right: 0;
  }

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

@media (max-width: 720px) {
  .app-frame {
    flex-direction: column;
  }

  .app-nav {
    width: auto;
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }

  .nav-group {
    display: flex;
    gap: 4px;
  }

  .nav-group + .nav-group {
    margin: 0;
    padding: 0 0 0 8px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

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

  .signed-in-as {
    display: none;
  }

  .app-brand img {
    height: 26px;
  }
}

/* New Task sheet */

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  background: rgba(22, 37, 42, 0.35);
}

.sheet-layer .sheet-layer {
  z-index: 50;
}

.sheet {
  width: min(1280px, 100%);
  height: min(960px, 100%);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(22, 37, 42, 0.22);
  padding: 24px;
}

.sheet--picker {
  width: min(400px, 100%);
  height: auto;
  max-height: min(560px, 100%);
  overflow: auto;
}

.sheet.sheet--facility {
  width: min(420px, 100%);
  height: auto;
}

.sheet--facility .sheet-head h2 {
  flex: 1;
}

.sheet-model {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.sheet-model > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.sheet-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sheet-field select {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 15px;
}

.sheet--date,
.sheet--priority {
  width: min(340px, 100%);
}

.sheet.sheet--dimensions {
  width: min(360px, 100%);
}

.sheet-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 15px;
}

.sheet--picker input[type="date"] {
  width: 100%;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 15px;
}

.sheet--people {
  width: min(400px, 100%);
}

.sheet-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sheet-title {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sheet-title-note {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-head--picker h2 {
  font-size: 17px;
  flex: 1;
}

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

.sheet-head-actions {
  margin-left: auto;
}

.sheet-foot {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sheet-foot .sheet-btn--primary {
  margin-left: auto;
}

.sheet-btn {
  width: auto;
  margin: 0;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.sheet-btn:hover {
  background: var(--wash);
}

.sheet-btn--primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.sheet-btn--primary:hover {
  background: var(--blue-press);
  border-color: var(--blue-press);
}

.sheet-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.sheet-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sheet-icon:hover {
  background: var(--wash);
  color: var(--ink);
}

.sheet-icon svg,
.picker-chevron svg,
.choice-mark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: 20px 12px 12px;
}

.sheet-body > * {
  flex-shrink: 0;
}

.sheet-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.sheet-field > span,
.sheet-field > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.sheet-field input,
.sheet-field textarea {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.sheet-field textarea {
  min-height: 72px;
  max-height: 160px;
  resize: vertical;
}

.sheet-field input::placeholder,
.sheet-field textarea::placeholder {
  color: #8b939a;
}

.sheet-field textarea.sheet-area--short {
  min-height: 40px;
}

.sheet-rule {
  flex: 0 0 1px;
  height: 1px;
  margin: 4px 0;
  border: 0;
  background: color-mix(in srgb, var(--blue) 55%, transparent);
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

button.menu-row:disabled {
  cursor: default;
  opacity: 0.72;
}

.menu-row-value {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.menu-empty {
  color: var(--muted);
}

.menu-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.menu-chevron {
  flex: 0 0 auto;
  color: var(--muted);
}

.sheet-lead,
.sheet-caption {
  margin: 0;
  color: var(--muted);
}

.sheet-lead {
  font-size: 15px;
  line-height: 1.35;
}

.sheet-caption {
  font-size: 12px;
}

.sheet-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 12px;
  border: 1px solid rgba(22, 37, 42, 0.12);
  border-radius: 8px;
  background: #fff;
}

.sheet-panel textarea {
  flex: 1;
  min-height: 160px;
  border: 0;
  background: transparent;
  resize: none;
}

.sheet-search-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.sheet-search-icon {
  color: #c4c4c6;
}

.sheet-search-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.sheet-field input:focus-visible,
.sheet-field textarea:focus-visible,
.picker-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.sheet-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sheet-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fde8e8;
  color: #6d1c1c;
  font-size: 13px;
}

.sheet-slider {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-slider input[type="range"] {
  flex: 1;
  width: auto;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.sheet-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: #d5d8dd;
}

.sheet-slider input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 0.5px solid #c8c8c8;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.25);
  appearance: none;
}

.sheet-slider input[type="range"]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: #d5d8dd;
}

.sheet-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0.5px solid #c8c8c8;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.25);
}

.sheet-slider input[type="range"]:disabled {
  cursor: default;
  opacity: 0.45;
}

.sheet-slider-value {
  width: 52px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.sheet--alert {
  width: min(340px, 100%);
  height: auto;
  padding: 20px 18px 16px;
  border-radius: 16px;
  overflow: visible;
}

.sheet--alert h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.alert-copy,
.alert-ask {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.35;
}

.alert-ask {
  margin-top: 14px;
}

.alert-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.alert-btn {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: #e5e5e7;
  color: #1d1d1f;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.alert-btn--cancel:hover {
  background: #d8d8dc;
}

.alert-btn--delete {
  background: #ffd4d4;
  color: #e03131;
}

.alert-btn--delete:hover {
  background: #ffc4c4;
}

.sheet.sheet--warn {
  width: min(480px, 100%);
  height: auto;
  min-height: 220px;
  padding: 24px;
  border-radius: 16px;
  overflow: visible;
}

.sheet--warn h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.warn-copy {
  margin: 16px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}

.warn-count {
  margin: 16px 0 0;
  color: #e03131;
  font-size: 15px;
  font-weight: 600;
}

.warn-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 28px;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.picker-row:hover {
  border-color: var(--blue-40);
}

.picker-value {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.picker-empty {
  color: var(--muted);
  font-size: 14px;
}

.picker-chip {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
}

.picker-chevron {
  display: inline-flex;
  color: var(--muted);
}

.sheet-assigned {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: -8px;
}

.sheet-assigned:empty {
  display: none;
}

.sheet-assigned-name {
  font-size: 14px;
}

.sheet-assigned-by {
  color: var(--muted);
  font-size: 12px;
}

.sheet-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 15px;
}

.sheet-switch input {
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: #c5d0d8;
  cursor: pointer;
}

.sheet-switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 37, 42, 0.2);
}

.sheet-switch input:checked {
  background: var(--blue);
}

.sheet-switch input:checked::after {
  transform: translateX(16px);
}

.cal {
  margin-top: 12px;
}

.cal-head {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 600;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-dow {
  padding: 4px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.cal-day {
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.cal-day.is-out {
  color: #9aa8b0;
}

.cal-day.is-today {
  box-shadow: inset 0 0 0 1px var(--blue-40);
}

.cal-day.is-selected,
.cal-day.is-selected.is-today {
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}

.cal-day:hover {
  background: var(--blue-20);
}

.cal-day.is-selected:hover {
  background: var(--blue-press);
}

.choice-list {
  height: 220px;
  margin-top: 16px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(22, 37, 42, 0.12);
  border-radius: 8px;
  background: var(--wash);
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.choice:hover {
  background: #fff;
}

.choice-mark {
  display: inline-flex;
  margin-left: auto;
  color: var(--muted);
}

.choice-rule {
  height: 1px;
  margin: 6px 0;
  background: var(--line);
}

.choice-empty,
.choice-hint {
  margin: 28px 12px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .nav-link,
  .sheet-switch input::after {
    transition: none;
  }
}
