.admin-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.admin-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(24px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) 16px 48px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-header h1 {
  margin: 0;
  font-size: 22px;
}

.admin-user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.admin-card {
  background: var(--panel);
  border: 1px solid #3d5163;
  border-radius: 12px;
  padding: 16px 18px 20px;
  margin-bottom: 16px;
}

.admin-card h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.admin-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.admin-form {
  display: grid;
  gap: 10px;
}

.admin-form.inline {
  grid-template-columns: 1fr 1fr auto auto;
  align-items: end;
}

.admin-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.admin-form input {
  background: #243140;
  border: 1px solid #3d5163;
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.admin-btn {
  background: #36556b;
  color: var(--text);
  border: 1px solid #7ea3bf;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

a.admin-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.admin-btn.ghost {
  background: transparent;
}

.admin-error {
  color: #f0a0a0;
  font-size: 13px;
  margin: 8px 0 0;
}

.invite-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.invite-result input {
  background: #243140;
  border: 1px solid #3d5163;
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #2f4456;
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.admin-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.admin-actions button {
  background: transparent;
  border: 1px solid #3d5163;
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.schedule-section {
  margin: 16px 0 0;
  font-size: 14px;
}

.sheet-editor-bar {
  margin: 8px 0;
}

.sheet-editor .sheet {
  max-width: none;
  margin: 8px 0 12px;
}

.sheet-editor .sheet input,
.sheet-editor .sheet select {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  padding: 0;
  min-width: 0;
}

.sheet-editor .sheet-inline {
  width: auto;
  border-bottom: 1px dashed #b7ad99;
  text-align: left;
}

.sheet-legend {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.sheet-legend span {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--ink);
  font-weight: 700;
}

.sheet-legend .legend-lunch {
  background: var(--lunch);
}

.sheet-legend .legend-change {
  background: var(--change);
}

.sheet-editor .sheet-meta p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sheet-editor .sheet-meta input {
  border: 1px solid #2a2a2a;
  background: #fffdf8;
  border-radius: 4px;
  padding: 3px 6px;
  min-width: 4.5em;
}

.sheet-editor .sheet-meta input[name="startPoint"] {
  min-width: 8em;
  flex: 1;
}

.sheet-editor .sheet-depot {
  width: 100%;
}

.sheet-editor .sheet-route input {
  width: 5.5em;
  text-align: left;
}

.sheet-editor .sheet-title select,
.sheet-editor .sheet-title input {
  font-weight: 700;
}

.sheet-editor .sheet td input,
.sheet-editor .sheet td.note input {
  width: 100%;
  text-align: center;
}

.sheet-editor .sheet td.note input {
  text-align: left;
  font-weight: 700;
}

.sheet-editor .sheet td.note-merge input {
  text-align: center;
}

.sheet-editor .sheet td input::placeholder {
  color: #b0a898;
}

.sheet-editor .sheet-row-del {
  width: 28px;
  min-width: 28px;
  border: 0;
  background: transparent;
  padding: 0;
}

.sheet-editor .sheet-row-del button {
  border: 0;
  background: transparent;
  color: #a33;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.sheet-editor-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.sheet-editor-bar label input[type="number"] {
  width: 64px;
  background: #243140;
  border: 1px solid #3d5163;
  border-radius: 6px;
  color: var(--text);
  padding: 4px 6px;
  font: inherit;
  font-size: 12px;
}

.schedule-new-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #3d5163;
}

@media (max-width: 640px) {
  .admin-form.inline {
    grid-template-columns: 1fr;
  }

  .invite-result {
    grid-template-columns: 1fr;
  }
}
