:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --line: #e3e6ed;
  --text: #1f2937;
  --muted: #6b7280;
  --blue: #3b82f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8f9fc 0%, #f2f4f8 100%);
  color: var(--text);
}

.page {
  width: min(1280px, 96vw);
  margin: 28px auto 40px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 14px;
}

.top h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.admin-side-menu {
  position: fixed;
  left: 16px;
  top: 92px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 10px;
}

.admin-side-menu h3 {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-nav-link {
  border: 1px solid #d4dde9;
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px 10px;
  font-size: 13px;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  display: block;
}

.admin-nav-link:hover {
  background: #eef4fb;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.detail-item .label,
.step-fields .label,
.extra-item .label {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 4px;
}

.label-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  opacity: 0.8;
}

.icon-calendar {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.icon-location {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 1 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.icon-user {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.icon-clock {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}

.detail-item .value,
.extra-item .value {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.detail-item:first-child .value {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.track h2 {
  font-size: 32px;
  margin-bottom: 10px;
  font-weight: 600;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 10px;
}

.step-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  overflow-x: auto;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.step-fields p {
  margin: 4px 0;
  font-size: 14px;
  white-space: nowrap;
}

.step-row {
  margin: 4px 0;
}

.step-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.step-row.two-col p {
  margin: 0;
  white-space: nowrap;
}

.date-edit {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

.acd-choice {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.acd-choice.show {
  display: inline-flex;
}

.acd-choice-label {
  color: var(--muted);
  font-size: 12px;
}

.acd-choice button {
  border: 1px solid #d4dde9;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
}

.acd-choice button:hover {
  background: #eef4fb;
}

.acd-choice button.ghost {
  background: #fff;
}

.date-inline {
  display: inline-flex;
  align-items: center;
}

.date-value-btn {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.date-value-btn:hover {
  color: var(--blue);
  border-color: #94a3b8;
}

.date-editor {
  display: none;
  align-items: center;
  gap: 6px;
}

.date-inline.editing .date-value-btn {
  display: none;
}

.date-inline.editing .date-editor {
  display: inline-flex;
}

.date-edit input[type="date"] {
  border: 1px solid #d4dde9;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

.step-fields .value {
  font-weight: 600;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill-green {
  background: #e7f8ec;
  color: #166534;
}

.status-pill-yellow {
  background: #fff7dc;
  color: #92400e;
}

.status-pill-red {
  background: #ffe7e7;
  color: #991b1b;
}

.status-pill-neutral {
  background: #edf1f6;
  color: #475569;
}

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

.extra-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.extra-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  padding-left: 2px;
}

.meta p {
  margin: 4px 0;
}

.project-search {
  width: 100%;
  max-width: 420px;
  border: 1px solid #d4dde9;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.admin-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.project-filter {
  border: 1px solid #d4dde9;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

.status-multiselect {
  position: relative;
}

.status-toggle {
  min-width: 180px;
  text-align: left;
}

.status-filter-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 260px;
  border: 1px solid #d4dde9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  padding: 8px;
}

.status-filter-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13px;
  color: #334155;
}

.status-filter-option:hover {
  background: #f4f7fb;
}

.status-filter-option input[type="checkbox"] {
  margin: 0;
}

.status-filter-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.status-action-btn {
  border: 1px solid #d4dde9;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.status-action-btn.primary {
  background: #eef4ff;
  border-color: #bcd0f6;
  color: #1d4ed8;
  font-weight: 600;
}

.admin-summary {
  margin: 2px 0 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-pill {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid #d8e1ed;
  background: #f6f8fb;
  color: #334155;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
}

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

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

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 95px;
  text-align: center;
  white-space: nowrap;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 170px;
  text-align: left;
  white-space: nowrap;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
  width: 120px;
  text-align: left;
  white-space: nowrap;
}

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
  width: 135px;
  text-align: center;
  white-space: nowrap;
}

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) {
  width: 125px;
  text-align: right;
  white-space: nowrap;
}

.admin-table th:nth-child(7),
.admin-table td:nth-child(7) {
  width: 135px;
  text-align: right;
  white-space: nowrap;
}

.admin-period {
  margin: 18px 0 8px;
  font-size: 16px;
  font-weight: 650;
}

.admin-empty {
  color: var(--muted);
  margin: 8px 0 0;
}

.metrics-import {
  width: 100%;
  min-height: 220px;
  border: 1px solid #d4dde9;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  resize: vertical;
  margin: 10px 0;
}

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

a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .admin-side-menu {
    position: static;
    width: min(100%, 360px);
    margin: 10px auto 0;
  }

  .track h2 {
    font-size: 26px;
  }

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

  .step-row.two-col {
    grid-template-columns: 1fr;
  }
}
