:root {
  color-scheme: light dark;
  font-family: "Segoe UI", Roboto, sans-serif;
  background-color: #f5f7fb;
  color: #1d2533;
  accent-color: #2064ff;
}

body {
  margin: 0;
  min-height: 100vh;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
}

.page-header p {
  margin: 0;
  color: #4d5a6d;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: end;
}

.equipment-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  background: #f8faff;
  border: 1px solid #d7deea;
  border-radius: 0.9rem;
}

.equipment-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.equipment-label span {
  font-size: 0.85rem;
  color: #4d5a6d;
}

.equipment-bar button#change-equipment {
  background: linear-gradient(180deg, #6b7bff 0%, #4f5fff 100%);
  box-shadow: 0 4px 12px rgba(32, 100, 255, 0.25);
  border: 1px solid rgba(32, 100, 255, 0.5);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.equipment-bar button#change-equipment::before {
  content: "⚙️";
  font-size: 1rem;
}

.equipment-bar button#change-equipment:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}

.equipment-bar button#change-equipment:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.equipment-bar button#change-equipment:focus-visible {
  outline: 3px solid rgba(32, 100, 255, 0.35);
  outline-offset: 2px;
}

.meta-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
}

.meta-grid input {
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid #c4ccda;
  font-size: 1rem;
}

.meta-grid input:focus-visible {
  border-color: #2064ff;
  outline: 2px solid rgba(32, 100, 255, 0.25);
}

.button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.drive-status {
  margin: 0;
  font-size: 0.9rem;
  color: #4d5a6d;
}

.drive-status[data-tone="success"] {
  color: #00796b;
}

.drive-status[data-tone="warning"] {
  color: #ff8c00;
}

.drive-status[data-tone="error"] {
  color: #c62828;
}

.button-group button {
  padding: 0.55rem 0.9rem;
  border-radius: 0.6rem;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #2064ff;
  color: #fff;
  transition: filter 0.2s ease;
}

.button-group button:nth-child(2) {
  background: #ff5c5c;
}

.button-group button:nth-child(3) {
  background: #009688;
}

.button-group button:hover {
  filter: brightness(0.9);
}

.button-group button.is-loading {
  opacity: 0.7;
  cursor: progress;
}

/* Simple modal popup */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal {
  background: #fff;
  color: #1d2533;
  width: min(560px, 100%);
  border-radius: 0.9rem;
  box-shadow: 0 12px 36px rgba(23, 32, 51, 0.25);
  border: 1px solid rgba(164, 176, 192, 0.5);
  padding: 1.25rem 1.25rem 1rem;
}

.modal h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.modal p {
  margin: 0 0 1rem;
  color: #4d5a6d;
}

.modal .options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.modal .option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #c4ccda;
  border-radius: 0.6rem;
}

.modal .actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.modal .actions button {
  padding: 0.55rem 0.9rem;
  border-radius: 0.6rem;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #2064ff;
  color: #fff;
}

.modal .actions button.secondary {
  background: #c4ccda;
  color: #1d2533;
}

.summary {
  background: #fff;
  border-radius: 1rem;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.08);
}

.summary h2 {
  margin: 0 0 0.75rem;
  font-size: 1.3rem;
}

.summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.summary li {
  font-size: 0.95rem;
  color: #4d5a6d;
}

.summary strong {
  color: #1d2533;
  font-size: 1.1rem;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.checklist-section {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.06);
  border: 1px solid rgba(164, 176, 192, 0.3);
}

.checklist-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.checklist-group + .checklist-group {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(209, 217, 230, 0.7);
}

.checklist-group h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #273349;
}

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

.items-table thead {
  background: rgba(32, 100, 255, 0.08);
}

.items-table th,
.items-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(209, 217, 230, 0.7);
}

.items-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4d5a6d;
}

.items-table tr:last-child td {
  border-bottom: none;
}

.items-table td:nth-child(3),
.items-table td:nth-child(4) {
  width: 120px;
}

.items-table td:nth-child(5) {
  width: 180px;
}

.status-options {
  display: flex;
  gap: 0.5rem;
}

.status-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: #32425c;
}

.quantity-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #c4ccda;
  font-size: 0.95rem;
}

.notes-input {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #c4ccda;
  font-size: 0.95rem;
  resize: vertical;
}

.status-ok {
  background: rgba(0, 128, 0, 0.12);
}

.status-missing {
  background: rgba(255, 92, 92, 0.12);
}

.status-na {
  background: rgba(255, 193, 7, 0.16);
}

@media (max-width: 920px) {
  .items-table thead {
    display: none;
  }

  .items-table,
  .items-table tbody,
  .items-table tr,
  .items-table td {
    display: block;
    width: 100%;
  }

  .items-table tr {
    margin-bottom: 1rem;
    border: 1px solid rgba(209, 217, 230, 0.7);
    border-radius: 0.75rem;
    padding: 0.75rem;
  }

  .items-table td {
    border: none;
    padding: 0.25rem 0;
  }

  .items-table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #4d5a6d;
    margin-bottom: 0.2rem;
  }

  .status-options {
    justify-content: flex-start;
  }
}
