:root {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0c1a2b;
  background: #f5f6fa;
  line-height: 1.4;
}

body {
  margin: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 24px 32px 16px;
  background: white;
  border-bottom: 1px solid #e0e4ec;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-header h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.page-header .subtitle {
  margin: 0;
  color: #6f7b94;
}

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

.filters label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #6f7b94;
}

.filters input {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #cbd2e1;
}

.filters button {
  padding: 8px 18px;
  border-radius: 6px;
  border: none;
  background: #155edc;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  padding: 24px 32px 48px;
}

.card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 180px;
  overflow: hidden;
}

.pill-toggle {
  border: 1px solid #dbeafe;
  background: #ffffff;
  color: #111827;
  border-radius: 999px;
  height: 28px;
  min-width: 56px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}
.pill-toggle.is-amount {
  background: #eef2ff;
  border-color: #cbd5f5;
  color: #0f172a;
}
.pill-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.temperature-mode-toggle {
  position: absolute;
  bottom: 8px;
  right: 44px;
  z-index: 20;
}

.card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0;
  font-size: 18px;
}

.card .meta {
  color: #64748b;
  font-size: 13px;
}

.card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 100%;
}

.card table th,
.card table td {
  text-align: left;
  padding: 6px 4px;
}

.card table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  white-space: nowrap;
}
.card table td {
  word-break: break-word;
}
.text-nowrap {
  white-space: nowrap;
}
.card table th.cell-numeric,
.card table td.cell-numeric {
  text-align: center;
}

.temperature-card table {
  table-layout: auto;
}
.temperature-card table th,
.temperature-card table td {
  font-size: 13px;
}
.temperature-card .cell-numeric {
  white-space: nowrap;
}
.temperature-card .status-pill {
  padding: 2px 6px;
  font-size: 12px;
}
.temperature-card .link-value {
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2ff;
  color: #1d4ed8;
}

.badge.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.warning {
  background: #fef3c7;
  color: #92400e;
}
.badge.success {
  background: #dcfce7;
  color: #15803d;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  min-width: 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  background: #e2e8f0;
  color: #111827;
}
.status-pill.status-good {
  background: #dcfce7;
  color: #15803d;
}
.status-pill.status-warn {
  background: #fef9c3;
  color: #b45309;
}
.status-pill.status-bad {
  background: #fee2e2;
  color: #b91c1c;
}
.no-access {
  background: white;
  border-radius: 14px;
  padding: 48px 32px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  text-align: center;
  font-size: 16px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.no-access h2 {
  margin: 0;
  font-size: 20px;
}
.no-access p {
  margin: 0;
  color: #475569;
}
.card--double {
  grid-column: span 2;
}
@media (max-width: 900px) {
  .card--double {
    grid-column: span 1;
  }
}
.stage-duration-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stage-duration-list__item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.stage-duration-days {
  font-size: 12px;
  color: #475569;
}
.access-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #312e81;
  font-size: 13px;
}
.access-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: inherit;
}
.access-modal .content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.access-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.access-modal__chips-empty {
  color: #94a3b8;
  font-size: 14px;
}
.access-modal__tabs {
  display: flex;
  gap: 8px;
}
.access-modal__tabs button {
  border: 1px solid #cbd5f5;
  background: #eef2ff;
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  color: #334155;
}
.access-modal__tabs button.active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}
.access-modal__search {
  display: flex;
  gap: 8px;
}
.access-modal__search input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd2e1;
}
.access-modal__search button {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: white;
  cursor: pointer;
}
.access-modal__list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.access-modal__list-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}
.access-modal__list-item:last-child {
  border-bottom: none;
}
.access-modal__list-item:hover {
  background: #f8fafc;
}
.access-modal__list-item.active {
  background: #e0f2fe;
}
.access-modal__bitrix {
  align-self: flex-start;
  border: 1px solid #cbd5f5;
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  color: #1d4ed8;
}
.access-modal__bitrix:hover {
  background: #eef2ff;
}
.access-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.access-modal__footer button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
.access-modal__footer .primary {
  background: #2563eb;
  color: white;
}
.access-modal__footer .secondary {
  background: #e2e8f0;
  color: #1f2937;
}

.trend-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.trend-row span:last-child {
  font-weight: 600;
}

.link-value {
  border: none;
  background: none;
  color: #2563eb;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.link-value:hover:not(:disabled) {
  text-decoration: underline;
}

.link-value:disabled {
  color: #94a3b8;
  cursor: default;
}

.link-badge {
  cursor: pointer;
}

.link-badge:hover {
  opacity: 0.85;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f1f5f9;
}

.table-subtle {
  color: #94a3b8;
  font-size: 12px;
}

.overdue-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.overdue-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.overdue-summary__row strong {
  font-size: 18px;
}

.overdue-summary__row:disabled {
  opacity: 0.5;
  cursor: default;
}

.status-good {
  color: #15803d;
  font-weight: 600;
}

.status-warn {
  color: #b45309;
  font-weight: 600;
}

.status-bad {
  color: #b91c1c;
  font-weight: 600;
}

.link-value.status-good {
  color: #15803d;
}

.link-value.status-warn {
  color: #b45309;
}

.link-value.status-bad {
  color: #b91c1c;
}
